Grow your CSS skills. Land your dream job.

Div Width Issue

  • # December 24, 2012 at 4:18 pm

    My post views are in a div id called #postviews. Unfortunately, the width is being set to the width of its container, #content, rather than the size of the text inside #postviews.

    Any easy fix for this? I feel like this is an easy solution and I’m completely missing the answer.

    An example: [http://themeforward.com/demo2/?p=1971](http://themeforward.com/demo2/?p=1971 “http://themeforward.com/demo2/?p=1971″)

    Here is my CSS for post views

    #postviews {
    font-size:20px;
    background:#000;
    clear:both;
    color:#FFF;
    padding:5px
    }

    # December 24, 2012 at 5:09 pm

    add display:inline-block and it will be as wide as the content inside

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

You must be logged in to reply to this topic.

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