日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

css實現左邊div固定寬度,右邊div自適應撐滿剩下的寬度

作者:想做大熊貓飼養員 更新時間: 2022-04-11 編程語言

1.使用float

.use-float>div:first-child{ width:100px; float:left; } .use-float>div:last-child{ overflow:hidden; }

2.使用table

.use-table{ border-collapse:collapse; width:100%; } .use-table>tbody>tr>td:first-child{ width:100px; }

3.使用div模擬table?

.use-mock-table{ display:table; width:100%; } .use-mock-table>div{ display:table-cell; } .use-mock-table>div:first-child{ width:100px; }

4.使用flex

.use-flex{ display:flex; } .use-flex>div:first-child{ flex:none; width:100px; } .use-flex>div:last-child{ flex:1; }

?

原文鏈接:https://blog.csdn.net/qq_38397397/article/details/90182600

欄目分類
最近更新