CSS 100% height layout

You can do it with table style CSS properties, but still retain table less markup (which is still a win). Example HTML <div id=”container”> <div id=”header”><div>header</div></div> <div id=”content”><div>content</div></div> <div id=”footer”><div>footer</div></div> </div> CSS html, body { height: 100%; padding: 0; margin: 0; } #container { display: table; width: 100%; height: 100%; border: 1px solid red; text-align: … Read more

Fix custom font line-height with CSS

The issue here is not line height but vertical placement of glyphs, in particular the location of the text baseline. That’s something that the font designer has decided on; the designer draws glyphs and places them in the em square, the conceptual device that has height equal to (or defined to be) the font height. … Read more

Difference between and with text-align:center;?

the difference is not between <span> and <div> specifically, but between inline and block elements. <span> defaults to being display:inline; whereas <div> defaults to being display:block;. But these can be overridden in CSS. The difference in the way text-align:center works between the two is down to the width. A block element defaults to being the … Read more

Getting columns to wrap in CSS Grid

Neither HTML or CSS have any concept of when descendants of a container wrap. Essentially, the browser renders the document during an initial cascade. It does not reflow the document when a child wraps. Therefore, to change the number of columns, you will need to set a width limit somewhere along the line or use … Read more

How to extend css class with another style?

You will have to use a CSS preprocessor to do this. SASS placeholder %rounded-corner {} %corner {} %button-effective {} .button { @extend %rounded-corner; @extend %corner; @extend %button-effective; /* Some other styles. */ } .box { @extend %rounded-corner; } Compiles to: .button, .box { /* rounded-corner styles */ } .button { /* corner styles here */ … Read more