Grow your CSS skills. Land your dream job.

css content property

  • # December 14, 2011 at 8:52 am

    Hi,

    I was hoping someone would be able to help me i’ve come across this css property a few times now and was curious about what it does? I was hoping someone might be able to enlighten me.

    #div {
    content: “.”;
    }

    Thanks,

    # December 14, 2011 at 9:23 am

    It’ll just add a . in your content.

    Check out this article: http://css-tricks.com/6555-css-content/

    You’ll usually find that just adding a “.” is usually used for a clear fix hack, to clear floating elements.

    # December 16, 2011 at 1:08 am

    You can’t apply content to the original element. content is used only for generate pseudo elements. So, there would be only div:before and div:after allowed to place content

    # December 20, 2011 at 12:26 pm

    Thanks for the advice guys. I found using “.” did fix my floating elements. Still don’t understand why it fixed it, but it did. :)

    # December 20, 2011 at 12:57 pm

    Not my favorite method of clearing floats, but if it works for you, great! :)

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".