我有下面的HTML和CSS,其中徽标浮动在左侧,但我想让内容浮动在右侧。
<html>
<body>
<div id="logo">
<img src="images/logo.gif" height="376" width="198" alt="LOGO" title="" />
</div>
<div id="maintext">
<p id="main">First paragraph</p>
<p>Second paragraph.</p>
</div>
<footer>...</footer>
</body>
</html>在我的CSS中,logo的选择器是:
#logo {
display: block;
float: left;
}
#maintext {
padding: 0 0.5em 0 0.5em;
}正在发生的事情是,标志"images/logo.gif“显示在左边,但在页脚顶部。它应该显示在“主文本”选择器的左侧。
有什么想法吗?
发布于 2013-10-06 23:25:13
添加以下CSS:
footer {
clear: both;
}发布于 2013-10-06 23:27:06
我不太明白..。它将是:
float: right;https://stackoverflow.com/questions/19215104
复制相似问题