HTML左边和右边是固定的宽度但是中间是自动的布局方式
對于這個布局方式我們可以是用絕對定位的方式來實現這個效果
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文檔</title>
<style type="text/css">
body{ margin:0px; padding:0px;}
.left{ width:200px; height:500px; background:#666; position:absolute;left:0; top:0;}
.right{ width:300px; height:500px; background:#009; position:absolute; right:0; top:0;}
.crent{ height:500px; background:#069; margin:0 300px 0 200px;}
</style>
</head>
<body>
<div class="left"></div>
<div class="crent"></div>
<div class="right"></div>
</body>
</html>
如果想要使得中間有空隙的話就只要改一下right 和left的值就可以了margin:0 310px 0 210px;
轉載于:https://www.cnblogs.com/BoYu045535/p/3760003.html
總結
以上是生活随笔為你收集整理的HTML左边和右边是固定的宽度但是中间是自动的布局方式的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android获取屏幕实际高度跟显示高度
- 下一篇: struts2整合uploadify插件