Html div浮动问题
好的,我得到了这个div:Html div浮动问题,html,css,wordpress,Html,Css,Wordpress,好的,我得到了这个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; } 而且它不会像.grayblock那样位于
#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;
}
而且它不会像.grayblock那样位于.stripedbar的一侧。stripedbar会:
.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下面)
这是博客:
添加
清除:无属性到
标记或#内容。条目标题
,因为它当前不允许浮动元素移动到任意一侧。添加清除:无属性到
标记或内容。条目标题
,因为它不允许浮动元素移动到任意一侧当前。样式表中有以下代码:
h1, h2, h3, h4, h5, h6 {
clear: both;
font-weight: normal;
}
因此,.entry title
块正在清除.grayblock
的浮动。
您需要添加清除:无代码>到#内容。条目标题样式,它会很好地工作。您的样式表中有以下代码:
h1, h2, h3, h4, h5, h6 {
clear: both;
font-weight: normal;
}
因此,.entry title
块正在清除.grayblock
的浮动。
您需要添加清除:无代码>到#内容。条目标题
样式,它会很好地工作