我想像这样划分在默认 MVC3 布局中呈现的内容
<div id="main">
<div id="left">
@RenderBody()
</div>
<div id="right">
Feeds here!
</div>
</div>
但它变成了这样 这是我修复的 CSS 中的部分内容
#main #left
{
float:left;
}
#main #right
{
position:fixed;
padding-right:50px;
right:10px;
text-align:left;
}
#main {
padding: 30px 30px 15px 30px;
background-color:Black;
border-radius: 4px 0 0 0;
-webkit-border-radius: 4px 0 0 0;
-moz-border-radius: 4px 0 0 0;
clear:both;
color:White;
}
最佳答案
如何交换 HTML 中左侧上方的右侧 div:
<div id="main">
<div id="right">
Feeds here!
</div>
<div id="left">
@RenderBody()
</div>
</div>
然后是 css:
#main #left
{
}
#main #right
{
float:right;
padding-right:50px;
right:10px;
text-align:left;
}
关于css - float div 布局不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9342191/