标签:如何 table utf-8 init 利用 lang ppi float 固定
一、三列布局
三列布局要求:1.两边固定,中间自适应
2.当中列要完整显示
3.当中列要优先加载
1.圣杯布局
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <style> *{ margin: 0; padding: 0; } #content{ padding: 0 200px; overflow: hidden; } body{ min-width: 600px; } #header,#footer{ height: 20px; text-align: center; border: 1px solid; background: gray; } /*伪等高布局*/ #content .middle,#content .left,#content .right{ padding-bottom: 10000px; margin-bottom: -10000px; } #content .middle{ float: left; background-color: pink; width: 100%; } #content .left{ width: 200px; background-color: yellow; margin-left: -100%; float: left; position: relative; left: -200px; } #content .right{ width: 200px; background-color: yellow; margin-left: -200px; float: left; position: relative; right: -200px; } .clearfix::after,.clearfix::before{ content: ""; display: table; clear: both; } </style> </head> <body> <div id="header">Header</div> <div id="content" class="clearfix"> <div class="middle">Middle</div> <div class="left">Left</div> <div class="right">Right</div> </div> <div id="footer">Footer</div> </body> </html>
2.双飞翼布局
两组实现布局方法的对比
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <style> *{ margin: 0; padding: 0; } #header,#footer{ border: 1px solid; background-color: gray; text-align: center; } body{ min-width: 600px; } /* 伪等高布局 */ #content{ overflow: hidden; } #content .middle,#content .left,#content .right{ padding-bottom: 10000px; margin-bottom: -10000px; float: left; } #content .middle{ background-color: pink; width: 100%; } #content .m_inner{ padding:0 200px; } #content .left,#content .right{ background-color: deeppink; width: 200px; text-align: center; } #content .left{ margin-left: -100%; } #content .right{ margin-left: -200px; } </style> </head> <body> <div id="header">Header</div> <div id="content"> <div class="middle"> <div class="m_inner"> middle </div> </div> <div class="left">Left</div> <div class="right">Right</div> </div> <div id="footer">footer</div> </body> </html>
二.双列布局
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <style> *{ margin: 0; padding: 0; } body{ min-width: 600px; } div{ height: 200px; } #left{ width: 200px; background-color: pink; float: left; } #right{ overflow: hidden; background-color: deeppink; } </style> </head> <body> <div id="left">Left</div> <div id="right">Right</div> </body> </html>
标签:如何 table utf-8 init 利用 lang ppi float 固定
原文地址:https://www.cnblogs.com/Wu-Zi-Qian/p/11754239.html