Home > Article > Web Front-end > How to Create Side-by-Side Divs with Equal Auto Widths using CSS?
CSS Side-by-Side Divs with Equal Auto Widths
Achieving equal auto widths for child DIVs within a parent DIV can be tricky with traditional float and width approaches. However, using the display: table property provides a modern solution that enables this functionality.
Solution using Display: Table
CSS Example:
#wrapper { display: table; table-layout: fixed; width: 90%; height: 100px; background-color: Gray; } #wrapper div { display: table-cell; height: 100px; }
HTML Example:
<div>
Note:
The above is the detailed content of How to Create Side-by-Side Divs with Equal Auto Widths using CSS?. For more information, please follow other related articles on the PHP Chinese website!