Alex Rivera | Logout

Hidden features of CSS

Asked 2009-03-09T23:17:27.777
59

I have definitely picked up some useful tips in the hidden features style questions concerning PHP and XHTML.

So here is one to cover CSS. While easy to pick up, it takes a little while to learn about everything, their default behaviors, properties etc

Here are some to start the ball

@charset "UTF-8"; /* set the character set. must be first line as Gumbo points out in comments */

.element {
        /* takes precedence over other stylings */
        display: block !important;

        /* mozilla .... rounded corners with no images */
        -moz-border-radius: 10px; 

        /* webkit equivalent */
        -webkit-border-radius: 10px 
}

These are not so much hidden, but their use is not often widespread. What tips, tricks, rare features have you discovered with CSS?

Edit
Report

4 Answers

58

You can display the document’s title element:

head, title {
    display: block;
}
answered 2010-01-26T08:05:31.540
7

Not so much hidden features, but a question featuring CSS tips which every beginning developer should know about

answered 2009-03-09T23:28:25.800
6

Currently only for WebKit but quite interesting: CSS Animations

answered 2009-03-09T23:50:52.270
3

Cross-browser (IE6+, FF, Safari) float alternative:

.inline-block {
    display: inline-block;
    display: -moz-inline-box;
    -moz-box-orient: vertical;
    vertical-align: top;
    zoom: 1;
    *display: inline; }
answered 2009-12-29T07:01:50.997

Your Answer