在将来的HTML或CSS版本中会有明星大小调整吗?

knu*_*nut 4 html css

在WPF中,您可以通过将宽度设置为星形来设置列的宽度以占用剩余空间.在将来的HTML或CSS版本中会有类似的东西吗?

例:

<div style="float: left; width: 50px;">
  Occupies 50px of the page width
</div>
<div style="float: left; width: 1*;">
  Occupies 25% of the rest of the page width
</div>
<div style="float: left; width: 3*;">
  Occupies 75% of the rest of the page width
</div>
Run Code Online (Sandbox Code Playgroud)

如果可以在未来版本的浏览器中实现,那将真正帮助Web开发人员.

Gum*_*mbo 6

CSS 3有一个模板布局模块,可以执行类似的操作.


编辑     但你已经可以这样做了:

<div style="padding-left: 50px">
    <div style="float: left; width: 50px; margin-left: -50px;">
        Occupies 50px of the page width
    </div>
    <div style="float: left; width: 25%">
        Occupies 25% of the rest of the page width
    </div>
    <div style="float: left; width: 75%;">
        Occupies 75% of the rest of the page width
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

附加padding-leftmargin-left调整是使外部的内容模型DIV在100%减去50px宽度.