I'm curious if there's a way to set the CSS with an x
(unknown) percentage amount, like height: *%;
. If it's not possible, how can I make it take the size of the rest of the screen?
I experimented in http://jsfiddle.net/omarjuvera/xnau2wsL/ and http://jsfiddle.net/omarjuvera/xnau2wsL/1/, but in this fiddle, these div
elements aren't taking the desired screen height size or using the whole screen together.
HTML
<div id="hello">Hello</div>
<div id="world">world</div>
<div id="shout">!</div>
CSS
#hello {
border: solid black 2px;
min-height: 10%;
}
#shout {
border: solid brown 2px;
/*inherit height from content*/
}
#world {
border: solid blue 4px;
height: *;
}
I prefer not to set a height with pixels and overflow since I want to have a mobile-friendly (Responsive Web Design) CSS.
Notes
- Height size for
#hello
is known as10%
of media (screen) size - Height size for
#shout
is unknown (inherited from the content) - Height size for
#world
is the remaining percentage (x%
) of the media - Can this be achieved without changing the semantics? -No container or changes, just CSS