在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开发人员.
编辑 但你已经可以这样做了:
<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-left
和margin-left
调整是使外部的内容模型DIV
在100%减去50px宽度.
归档时间: |
|
查看次数: |
834 次 |
最近记录: |