我已经在并排(row) div上阅读了一大堆SO问题/答案,但我认为我没有掌握它,因为我无法为我的特定设置找到解决方案:
http://www.trforums.com/h18-iwaku
基本上,我希望最底部的div位于“嘿,什么事”、“导航”和“连接”框的右侧,而不是仅仅在它们下面。这有可能做到吗?
divs本身就是具有其相应的html内容的类。这是非常基本的,但这是我的代码:
http://pastebin.com/AQrqqewA
我的html非常生疏,所以其他建议非常受欢迎。谢谢你的帮助。
发布于 2013-06-27 15:11:10
尝试将DIV中的每一列括起来:
<!-- Left column -->
<div id="leftColumn">
<div class="ex">
<center><img style="display: inline;" src="http://i.imgur.com/wCP3WP3" alt="" /></center>
<h1>Hey, what's up?</h1>
</div>
<div class="navbar">
<b>NAVIGATION:</b> <a href="http://joshpho.weebly.com/zukan.html">Zukan</a> | <a href="http://joshpho.weebly.com/movies.html">Movies</a> | <a href="http://joshpho.weebly.com/retsuden.html">Retsuden</a> | <a href="http://joshpho.weebly.com/misc.html">Photography</a> |
</div>
<div class="connect">
<b>CONNECT:</b> <a href="http://joshpho.livejournal.com/profile">Livejournal</a>
</div>
</div>
<!-- Right column -->
<div id="rightColumn">
<div class="slideshow">
Bottom div that I want in a row with the top one...
</div>
</div>CSS:
#leftColumn {
float: left;
width: 410px; // Width of this column
}
#rightColumn {
float: left;
width: 500px; // Width od this column
}发布于 2013-06-27 15:33:17
将类为slideshow的div移到类为ex的div旁边,并应用浮点数,如JS Bin中所示
最终结果可以在here中看到
发布于 2013-06-27 15:01:53
在您想要相邻的div上使用float:left或display:inline。
https://stackoverflow.com/questions/17336543
复制相似问题