DIV CSS automatically adapts to width and height_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:31:04
Original
1086 people have browsed it

DIV CSS adaptive width:

<!DOCTYPE html/><html><head><title>自适应宽度实例--www.ops.cc</title><style type="text/css">/* 自适应宽度 */#left{width:150px;margin-right:-150px;float:left;}#center{width:auto;margin:0 0 0 150px;}#right{width:140px;margin-left:-140px;float:right;}/* 自适应高度度 *//* warp 用于隐藏溢出的部分 */#wrap{overflow:hidden;}#left,#center,#right{padding-bottom:20000px;margin-bottom:-20000px;}</style></head><body><div id="wrap"><div id="left" style="background:#333;height:600px;">左边栏,固定宽度150px;高度600px</div><div id="right" style="background:#555">右边栏,固定宽度150px;高度:自适应</div><div id="center" style="background:#888">中间栏,宽度:自适应,高度:自适应</div></div></body></html>
Copy after login

1. Note that when adapting to the width, arrange the left and right columns first and then let the middle column Arrange freely, so the order of

Related labels:
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