Html 自动将子Div拉伸到父级,并使用%vs px边距/填充

Html 自动将子Div拉伸到父级,并使用%vs px边距/填充,html,css,Html,Css,我似乎无法使子div延伸到父div,我也不确定是否需要在#完整页面内容上指定%width,即使#middle设置为76%??我好像忘了 **转到当单击按钮时,其各自的容器不适合容器的页面 以下是主要的CSS: #fullpage-content {clear:both;margin-top:1.5em;padding:10px 25px 30px;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;border:p

我似乎无法使子div延伸到父div,我也不确定是否需要在#完整页面内容上指定%width,即使#middle设置为76%??我好像忘了

**转到当单击按钮时,其各自的容器不适合容器的页面

以下是主要的CSS:

#fullpage-content {clear:both;margin-top:1.5em;padding:10px 25px 30px;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;border:px solid #e6e4e3;box-shadow:inset 0px 1px 4px #e0e0e0;background: -webkit-gradient(linear, left top, left bottom, from(#f3f1f1), to(#fff));}

.Advert .tab {box-shadow:inset 0px 1px 4px #cac7c6;background:#fff;padding:5px 18px 15px;margin:0 0 8px 0;clear:left;float:left;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;}

#contact {float:right;clear:right;width:220px;margin:15px 0 0 35px;}

.aboutus ul {list-style-image:url(/Assets/Images/SiteStructure/Advert-Template/bullet.gif);color:#4b4b4b;line-height:normal;padding-left:30px;}
.aboutus li  {padding:0 0 10px 5px;}
.abullets1, .abullets2 {float:left;width:30%;}
.bullets1, .bullets2  {width:33%;padding-left:20px;}
我还想知道是否需要添加位置:相对于任何容器div,并指定流体百分比边距/填充,以便它不会断裂?试图让它正常工作


非常感谢任何帮助

将元素的宽度设置为100%将使其与父元素的宽度相同。从你所给的,我不能很好地告诉什么是什么在你的CSS,但我会扔在一起小提琴给你看


但是如果它是div或block级别的元素,则不需要它,正如上面所评论的那样

block元素不需要
width:100%
。它们总是占据尽可能多的水平空间。