CSS的HTML动态布局与不固定的列?
问题描述:
我想设置这样的布局,两个列都是动态的 - 一个是由第一列和最小宽度的内容设置。我发现很多解决方案,其中栏固定的宽度,但它没有解决这个问题。
I want to set such layout both columns are dynamic - one is set by content second by the first column and minimum width. I found many solution where column is fixed with width but it no solves this problem.
看到我想在屏幕上实现。
See what I want achieve on screen.
>
我应该使用什么CSS?
What CSS I should use?
答
有这样的东西有不同的方法...一个简单的方法是使用 display:table;
为 display:table-cell;
There are different approaches for stuff like this ... an easy way would be to use display: table;
for the container display: table-cell;
for the childs and width: 1px;
for the first child.
我为你做了一个小提琴:
I have made a fiddle for you: