We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
相同点:
不同点:
效果是这样的:
<html> <style> .header, .footer { height: 100px; background-color: lightblue; } .center { height: 100%; width: 100%; background-color: green; } .left { left: -100px; width: 100px; height: 100%; margin-left: -100%; background-color: red; } .right { left: 200px; width: 200px; height: 100%; margin-left: -200px; background-color: yellow; } .wrapper >div{ position: relative; float: left; height: 800px; } .footer { clear: both; } .wrapper { padding: 0 200px 0 100px; } </style> <body> <div class="header"></div> <div class="wrapper"> <div class="center"></div> <div class="left"></div> <div class="right"></div> </div> <div class="footer"></div> </body> </html>
<html> <style> .header, .footer { height: 100px; background-color: lightblue; } .center { flex: 1; height: 100%; background-color: green; } .left { width: 100px; height: 100%; background-color: red; } .right { width: 200px; height: 100%; background-color: yellow; } .wrapper { display: flex; height: 800px; } </style> <body> <div class="header"></div> <div class="wrapper"> <div class="left"></div> <div class="center"></div> <div class="right"></div> </div> <div class="footer"></div> </body> </html>
<html> <style> .header, .footer { height: 100px; background-color: lightblue; } .inner { margin: 0 200px 0 100px; height: 100%; background-color: green; } .left { width: 100px; margin-left: -100%; background-color: red; } .right { width: 200px; margin-left: -200px; background-color: yellow; } .wrapper >div { float: left; height: 800px; } .footer { clear: both; } .center { width: 100%; } </style> <body> <div class="header"></div> <div class="wrapper"> <div class="center"> <div class="inner"></div> </div> <div class="left"></div> <div class="right"></div> </div> <div class="footer"></div> </body> </html>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
圣杯布局与双飞翼布局的对比
相同点:
不同点:
实现圣杯布局
第一种:利用float
效果是这样的:
第二种:利用flex
实现双飞翼布局
The text was updated successfully, but these errors were encountered: