CSS 将菜单与内容内联

标签 css

所以我有这个菜单,无论我做什么,它都不想与内容保持一致。 这里有一些照片,它现在(之前)如何以及我希望它如何(之后)。

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/

相关文章:

css - 我的 flexbox div 都在一列中对齐。我需要他们在一列中对齐一个,然后在两个 div 中的另一行中对齐

jquery - 进入视口(viewport)时将事件添加到元素列表

html - 如何删除 HTML 表格中列标题及其下方行之间的空格?

css - 为什么无样式的输入文本的边框宽度为 2px?

asp.net - 在 asp.net 中使用内联 css 是不好的做法吗?

html - 为什么 HTML/CSS 在大 p 标签后添加空间?

javascript - jQuery 在点击时不显示请求的数据

javascript - 谷歌地图物化选项卡下的 map

javascript - 设置 IE8 兼容性后,如何检测 IE8 与较新版本的区别

javascript - nghide 上的 ngAnimated 在我的情况下不起作用