treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Div Width Issue

  • 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

    Here is my CSS for post views

    #postviews {
      font-size:20px;
      background:#000;
      clear:both;
      color:#FFF;
      padding:5px
    }
    
  • add display:inline-block and it will be as wide as the content inside