SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Oct 2004
    Location
    alton
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Weird behaviour in Firefox (newbie)

    Hi

    http://www.bluetattoo.co.uk/csstest/test.htm

    I'm using a repeat-y background image with my main DIV, and a floated left DIV panel. I'd like the main DIV to stretch as long as the content in the left or right panel.

    Looks ok in IE6, but left content spills over in Firefox?

    Any advice appreciated!

    Thanks - Jason

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    You need to clear floats in firefox or they just float out of their parent container. (See FAQ on floats for more info)

    Code:
    .clearer{
     height:1px;
     overflow:hidden;
     margin-top:-1px;
     clear:both;
    }
    html:
    Code:
      <div class="rightpanel"> 
    	<div align="center"><img src="<A href="http://www.bluetattoo.co.uk/csstest/hv2000pic.jpg"></div">http://www.bluetattoo.co.uk/csstest/hv2000pic.jpg"></div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="homebar">Home</div>
    <div align="center"><br>
    </div>
    That will clear the float and make the parents background extend around the floated content.

    Paul

  3. #3
    SitePoint Member
    Join Date
    Oct 2004
    Location
    alton
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile Thanks!

    Paul - you are a star.

  4. #4
    SitePoint Addict RamsayX's Avatar
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is it allowed (according to standards I mean) to have a self-closing DIV tag? Like where you have the clearer DIV ...
    Personal Portfolio
    Paul O'B is the CSS god

  5. #5
    SitePoint Wizard silver trophy KLB's Avatar
    Join Date
    Nov 2003
    Location
    Maine USA
    Posts
    3,781
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RamsayX
    Is it allowed (according to standards I mean) to have a self-closing DIV tag? Like where you have the clearer DIV ...
    No, there must always be a closing tag for DIVs.
    Ken Barbalace: EnvironmentalChemistry.com (Blog, Careers)
    InternetSAR.org
    Volunteers Assist Search and Rescue via Internet
    My Firefox Theme: Classic Compact
    Based onFirefox's default theme but uses much less window space

  6. #6
    SitePoint Addict RamsayX's Avatar
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Gotcha, thanks.
    Personal Portfolio
    Paul O'B is the CSS god

  7. #7
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    You could use :
    <br class="clearer" />

    If thats what you were talking about.

    Paul


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
  •