SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: expanding div

  1. #1
    SitePoint Addict
    Join Date
    Mar 2007
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    expanding div

    What is the css to make a div tag expand to encompass its contents. I have a page that has variable sized elements and occasionally they will overlap the bottom of the div they are supposed to be surrounded by. Sorry to ask this but I know I have read it here but can't seem to find it.
    http://www.glasys.co.uk
    Noli Illegitimi Carborundum

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do nothing!

    You have to make an effort to prevent a DIV from expanding to encompass its content; either by setting a fixed height on it or by floating or positioning its content.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Addict
    Join Date
    Mar 2007
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    Do nothing!

    You have to make an effort to prevent a DIV from expanding to encompass its content; either by setting a fixed height on it or by floating or positioning its content.
    Thanks after checking I realised that I wasn't floating the element.
    http://www.glasys.co.uk
    Noli Illegitimi Carborundum


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •