CSS布局-两列左窄右宽型

    xiaoxiao2024-10-18  4

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>两列左窄右宽型</title> <style> * { margin: 0; padding: 0; } .top, /* 并集选择器 给相同样式集体声明 */ .banner, .main, .footer { width: 960px; margin: 0 auto; text-align: center; border: 1px dashed #ccc; margin-bottom: 8px; background-color: #eee; } .top { height: 80px; } .banner { height: 150px; } .main { height: 500px; } .footer { height: 120px; } .left { width: 360px; height: 500px; float: left; background-color: pink; } .right { width: 592px; height: 500px; float: right; background-color: purple; } </style> </head> <body> <div class="top">top</div> <div class="banner">banner</div> <div class="main"> <div class="left">left</div> <div class="right">right</div> </div> <div class="footer">footer</div> </body> </html>

    最新回复(0)