CSS
-
(CSS) How to center a div without width
I needed to center a div with dynamic content, so I couldn’t set a fixed width. Since margin: 0 auto; really won’t do anything if the element doesn’t have a fixed width you can solve it like this: HTML [html] <div id="container"> <div class="centered">My dynamic content, that will be centerd</div> </div> [/html] CSS [css] .centered…
-
CSS font stack
Great site for pulling out css for webfonts: http://cssfontstack.com
-
CSS3 box shadow
A nice feauture in CSS3 is the box-shadow. Instead of working with tedious PNG-images you can add shadows to any element with the CSS property box-shadow. The syntax works like this: box-shadow: <offset-x> <offset-y> <blur> <spread> <color> <inset> The offset settings will set the angle of the shadow. Where it will be cast in relation to…