css - Dynamic width with multiple elements -


I am trying to find a pure CSS method to inline 1 or more elements and fill them in I'm adjusting width like container

1 element

[------]

2 elements

[--- ***]

3 elements

[- ** ..]

Is it possible to get it through pure CSS?

Use display: table on parents, and display: table-cell on children so much as you You can add as many internal divisions as this:

HTML

  & lt; Div class = "container" & gt; & Lt; Div class = "inner" & gt; 1 & lt; / Div & gt; & Lt; Div class = "inner" & gt; 2 & lt; / Div & gt; & Lt; Div class = "inner" & gt; 3 & lt; / Div & gt; & Lt; / Div & gt;   

CSS:

 . Container {Display: Table; Width: 500px; Height: 300px; Profile: 1px solid red; } .INERI {DISPLAY: TABLE-SAIL; Profile: 1 px solid blue; }   

Here's the Bella:

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -