css左栏固定右栏宽度自适应
分类:实例代码
分享一段代码实例,它实现了左栏固定,右栏宽度自适应的功能。
代码实例如下:
<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="author" content="http://www.pipipi.net/" /> <title>前端教程网</title> <style> .box { width: 700px; border: 1px solid; } .box-left { width: 220px; background: red; height: 300px; float: left; } .box-right { margin-left: 220px; background: yellow; height: 300px; } </style> </head> <body> <div class="box"> <div class="box-left"></div> <div class="box-right"></div> </div> </body> </html>