2011-01-28 101 views
0

好了,所以我得到了这个div:DIV浮动问题

#content .entry-title { 
    color: #5d9851; 
    font-size: 21px; 
    font-weight: bold; 
    line-height: 1.3em; 
    margin-left: 30px; 
    width: 520px; 
    overflow: hidden; 
    border-bottom: 1px solid #97fb83; 
} 

和喜欢.stripedbar做它不会.grayblock的侧面去:

.stripedbar{ 
    background-position:left top; 
    background-repeat: repeat; 
    background-image:url('images/bar.png'); 
    height: 20px; 
    width: 520px; 
    margin-left: 30px; 
    margin-bottom: 0px; 
} 

.grayblock{ 
    background-color: #cccccc; 
    height: 40px; 
    width: 20px; 
    float: left; 
} 

任何想法如何使它打得很好(在.grayblock的一侧,并在.stripedbar下)?

这是博客: http://prime.programming-designs.com/blog/

回答

3

你有这样的代码在你的样式表:

h1, h2, h3, h4, h5, h6 { 
    clear: both; 
    font-weight: normal; 
} 

所以,.entry-title块被清除的.grayblock浮动。 您需要将clear:none;添加到#content .entry-title款式,它会很好。

0

添加clear:none财产<h2>标签或#content .entry-title,因为它不允许浮动元素任何一方目前。