时间:2023-09-26 10:48:01 | 来源:网站运营
时间:2023-09-26 10:48:01 来源:网站运营
DIV+CSS页面基本布局总结:<!DOCTYPE html><html><head> <title>一列水平居中布局</title> <meta charset="utf-8"></head><body> <div class="one-center-col">一列布局</div></body></html>
css代码:<style> .one-center-col { width: 1000px; height: 700px; background-color: grey; margin: 0 auto; }</style>
效果截图:<div class="container"> <div class="leftbox">左侧列</div> <div class="rightbox">右侧列</div></div>
左右列的css代码:.leftbox { width: 300px; height: 100%; background-color: #aadddd; float: left;} .rightbox { width: 700px; height: 100%; background-color: #f08844; float: right;}
效果截图<div class="container"> <div class="leftbox">左侧列</div> <div class="midbox">中间列</div> <div class="rightbox">右侧列</div></div>
css部分代码:.leftbox { width: 300px; float: left;}.midbox { width: 400px; float: left;}.rightbox { width: 300px; float: right;}
效果示意图.leftbox { width: 300px; height: 100%; background-color: #aadddd; float: left;}.rightbox { height: 100%; margin-left: 300px; background-color: #f08844;}
基本思路分析:.container { width: 1000px; height: 700px; margin: 0 auto; position: relative;}.leftbox { width: 300px; /*左侧固定宽度值*/ height: 100%; position: absolute;}.rightbox { height: 100%; margin-left: 300px; /*边距值=左侧固定宽度值*/ position: relative;}
基本思路分析:.leftbox { width: 300px; height: 100%; background-color: #aadddd; float: left;} .midbox { margin: 0 300px; height: 100%; background-color: #aa11dd;}.rightbox { width: 300px; height: 100%; background-color: #f08844; float: right;}
基本思路分析:.container { width: 1000px; height: 700px; margin: 0 auto; position: relative;}.leftbox { width: 300px; height: 100%; position: absolute; left: 0;}.midbox { margin: 0 300px; height: 100%; position: relative;}.rightbox { width: 300px; height: 100%; position: absolute; right: 0;}
思路分析:关键词:布局,总结,基本