我刚开始设计布局。
我已经完成了这个布局,但是每当我在容器中添加更多的文本或任何元素时,它都不会在容器中展开内部div。请更正我的css。
这是我的布局的css
@charset "utf-8";/* CSS文档*/ @media只显示屏幕{#满页{宽度:1100 50;高度:850 50;位置:相对;边距:auto;背景色:#999999;}标题{宽度:100%;高度:200 50;位置:相对;背景颜色:红色;}标题>导航{宽度:50%;高度:50%;边距:自动;位置:相对;}#移动{显示:无;背景色:橙色;}#满页>区段{宽度:100%;高度:100%;最小-高度:500 0px;位置:相对;背景颜色:黄色;}区段>旁边,部分>区段{宽度:500 0px;高度:100%;位置:绝对;顶部:0 0px;左:0 0px;背景颜色:粉红色;}节>边边{宽度:100 0px;左:1000 max;}节>部分{左:500 max;背景色:蓝色;}页脚{宽度:100%;高度:150 max;位置:相对;背景颜色:红色;}}@媒体只显示屏幕和(最大宽度:1024 max)和(最小宽度:801px){#全页宽度{1000 max;}头>导航{背景颜色:粉红色;}节>备用{显示:无;}@媒体仅打印{}@媒体只显示屏幕和(最大宽度:800 max){#满页{宽度:640 max;高度:1350 max;}头{背景颜色:莱姆;}标题>导航{宽度:75%;高度:50%;页边距:自动;}移动{显示:块;}#桌面{显示:无;}#满页>节{高度:1000 max;}区段>边段>区段{宽度:100%;高度:50%;位置:相对位置;左:0 0px;}区段>备用{显示:无;}}
这是我的HTML
<div id="fullPage">
<header>
<nav id="desktop">DESKTOP</nav>
<nav id="mobile">MOBILE</nav>
</header>
<section>
<aside>menu-1</aside>
<section>Lorem Ipsum is Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.There are many variations of passages of Lorem Ipsum available, but the majority</section>
<aside>menu-2</aside>
</section>
<footer>footer-1</footer>
</div>发布于 2014-02-16 14:56:53
您的内部“区段”元素有位置:绝对;因此它不“拉伸”它包含元素的高度(设置为500 to )。您实际上想要做的是不使用位置:绝对;因此,您的元素的高度可以更动态,使用“浮动”方法。
我建议如下:sbs.htm
https://stackoverflow.com/questions/21809850
复制相似问题