2 Replies - 716 Views - Last Post: 04 April 2013 - 05:12 AM

#1 jskidd3  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 16-September 12

Making a div expand to fit its contents

Posted 04 April 2013 - 02:10 AM

Hi,

On this site: http://joelkidd.co.uk/velvet/ I am trying to make it so #content expands based on #section-1's height. The reason for this is the company have asked me to create a CMS they can use. I've been using fixed heights for everything (which I suppose is bad web design for content that can be manipulated) and now I've obviously hit problems. Does anyone know how I can make #content expand based on #section-1's height?

Kind regards,
Joel

Is This A Good Question/Topic? 0
  • +

Replies To: Making a div expand to fit its contents

#2 andrewsw  Icon User is online

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3480
  • View blog
  • Posts: 11,844
  • Joined: 12-December 12

Re: Making a div expand to fit its contents

Posted 04 April 2013 - 04:12 AM

I haven't looked in detail but the first thing to do is to remove the height for #content. Then you might set it's overflow: auto; or :visible;, or add an element (if necessary) with clear: both; so that it clears any floated elements.
Was This Post Helpful? 0
  • +
  • -

#3 jskidd3  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 16-September 12

Re: Making a div expand to fit its contents

Posted 04 April 2013 - 05:12 AM

Ok thanks Andrew, I'll give that a go! :)

Oh my goodness, you are my new best friend. Thank you so much, worked perfectly!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1