Home > Web Front-end > HTML Tutorial > 请教div高度如何自适应屏幕分辨率_html/css_WEB-ITnose

请教div高度如何自适应屏幕分辨率_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:37:38
Original
1357 people have browsed it

图片总是上传不成功,简单的说就是左右两列div,请教如何让这两个div的高度自适应当前屏幕的分辨率,自动撑满屏幕?谢谢!


回复讨论(解决方案)

<html> <head> <style type="text/css">*{padding:0;margin:0;}.container{height:100%}html,body{height:100%;width:100%}.l{width:20%;background:#333;float:left;height:100%;}.r{width:80%;background:#666;float:right;height:100%;}</style> </head> <body> <div class="container">	<div class="l">dfsf</div>	<div class ="r">rrr</div> </div> </body> </html>
Copy after login

height:100%;

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template