2012-07-29 47 views
0

我似乎无法让子div伸展到父级,我不太确定是否需要在#fullpage上指定%width,内容尽管#middle设置为76%??我似乎已经忘记了..Auto Stretch Child Div to Parent and using%vs px margin/padding

** Here's a link到页面点击按钮时,他们各自的容器不适合容器。

这里的主要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容器,并指定流体%的利润率/填充,因此不破?试图让它正常工作...

任何帮助非常感谢!

+0

您的链接不起作用股利或块级元素。 – ChiefTwoPencils 2012-07-29 09:53:05

+0

块元素不需要'width:100%'。他们总是占用尽可能多的水平空间。 – 2012-07-29 09:58:44

回答

0

将元素的宽度设置为100%将使其与其父元素的宽度相同。从你给我的东西我不能告诉你什么是你的CSS,但不幸扔在一起的小提琴向你展示。

fiddle

但如果是肯定的,这是没有必要的注释上述