所以我有这个菜单,无论我做什么,它都不想与内容保持一致。 这里有一些照片,它现在(之前)如何以及我希望它如何(之后)。
http://s24.postimg.org/nqv765rhx/image.jpg http://s27.postimg.org/7jikbzrqr/image.jpg
代码如下:
#the website format{
width:1000px;
margin: 0 auto;
height:100%;
text-align:left;
}
#menu {
width:200px;
float:left;
padding-left:10px;
}
#wrapper{
width:1000px;
padding-left:10px;
padding-right:10px;
float:left;
}
#content {
float: left;
width: 800px;
padding: 0px;
}
.inside {
width: 220px;
height: 350px;
padding: 5px;
float:right;
display:inline-block;
margin:5px;
}
最佳答案
看看here , 这就是你想要的样子吗?
HTML
<div class='table'>
<div class='cell'>Menu</div>
<div class='cell'>Content</div>
</div>
CSS
body, html{
width:100%;
height:100%;
margin:0;
padding:0;
}
body{
position:fixed;
}
.table{
display:table;
height:100%;
width:100%;
}
.cell{
display:table-cell;
border:1px solid grey;
}
.cell:first-child{
width:100px;
}
关于CSS 将菜单与内容内联,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20282705/