Will there be a star size in future versions of HTML or CSS?

In WPF, you can set the column width to take up the remaining space by setting the width to the star. Will there be something similar in future versions of HTML or CSS?

Example:

<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> 

This will really help web developers if it is implemented in future versions of browsers.

+4
source share
3 answers

There is a template layout module for CSS 3 that does something similar.


Edit But you can already do this:

 <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> 

The additional padding-left and margin-left settings should contain the content model of the external DIV at a speed of 100% minus 50 pixels.

+6
source

You can already achieve this in HTML ...

Here is your example configured to work only in HTML.

 <div style="float: left; width: 50px;"> Occu- pies 50px of the page width </div> <div style="margin-left: 50px; width: 100%;"> <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> 
+2
source

The W3C CSS working group accepted the proposal for the percent minus pixels function, which can be used for the same effect as the star function.

This might work, although I'm not sure

 .fixedCol { width:200px; } .fluidCol { width:100% minus 200px; } 
+2
source

Source: https://habr.com/ru/post/1299414/


All Articles