2012-04-03 30 views

回答

3

http://jsfiddle.net/AHk78/

HTML

<div id="upleft"></div> 
<div id="upright"></div> 
<div id="below"></div>​ 

CSS

#upleft { width:100px; height: 500px; background:red; float:left; } 
#upright { width:300px; height:200px; background:blue; float:left } 
#below { height:300px; width:100%; background:green; clear:both } 
1

CSS:

#divA 
{ 
    float:left; 
    width: <width of div A>; 
} 
#divB 
{ 
    float:left; 
    width: <width of div B>; 
} 

#divC 
{ 
    clear:both; 
} 

HTML:

<div id="divA"></div> 
<div id="divB"></div> 
<div id="divC"></div> 
0

事情是这样的:

一个 float:left

B float:left;

C 明确:两者;

2

我会制作百分比,这样你就可以得到这些比例,无论用户有多大的屏幕尺寸。

CSS

#sectionA 
{ 
    float:left; 
    width: 20%; 
} 
#sectionB 
{ 
    float:left; 
    width: 80%; 
} 

#sectionB 
{ 
    clear:both; 
    width: 100%; 
} 

HTML

<div id="sectionA"></div> 
<div id="sectionB"></div> 
<div id="sectionC"></div> 
+0

欢呼编辑......这就是我得到的复制和粘贴:P – 2012-04-03 02:15:36

0

嗨,你可以让这个仅仅作为这样

的CSS

#left { 
    width:100px; 
    min-height: 300px; 
    background:red; 
    float:left; 
} 
#right { 
    min-height:200px; 
    background:blue; 
    float:left; 
    width:400px; 
} 

#bottom{ 
    height:200px; 
    background:green; 
    clear:both; 
} 
​ 

HTML

<div id="left"></div> 
<div id="right"></div> 
<div id="bottom"></div>​ 

现场演示link herehttp://jsfiddle.net/rohitazad/AHk78/2/

1

可以内嵌以下为右对齐例如使其:

<div style="width:30%;float:right"><!--write your required tags--></div> 

他重新宽度和浮点数取决于要求

相关问题