<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> #container{ display: flex; width: 500px; border: 1px solid red; } #box1{ background-color: mediumspringgreen; width: 100px; flex-grow: 0; } #box2{ background-color: greenyellow; flex-grow: 1; } </style> </head> <body> <div id="container"> <div id="box1"> 定宽 </div> <div id="box2"> 填满 </div> </div> </body> </html>
原文地址:https://www.cnblogs.com/223zzm/p/11279026.html
时间: 2024-11-05 12:14:08