SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict lundberg's Avatar
    Join Date
    Mar 2003
    Location
    Sweden
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE issue, div jumps down even though it shouldn't.

    Take a look at this:
    http://www.shell.linux.se/lundberg/test/css/index.htm

    In Mozilla everything is perfect. But in IE the content div jumps down. To make it go up I have to reduce it's size or change the margin-left to something smaller. But if I do that the site doesn't look right in Mozilla. What's wrong?

    Here is the css: http://www.shell.linux.se/lundberg/t.../css/style.css

    Thanks in advance!

    Martin Lundberg
    Sweden

  2. #2
    SitePoint Evangelist ClevaTreva's Avatar
    Join Date
    Jan 2004
    Location
    Chipping Campden, UK
    Posts
    403
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi

    The error is easy to fix.

    Change the html to this:

    Code:
    <body>
    <div id="maincontainer">
    	<div id="top"></div>
    	<div id="menu"></div>
    	<div id="mainbody">
    	<div id="leftbar">
    		<div class="leftbar_headers">&nbsp;</div>
    		<div id="topbody"></div>
    		<div class="leftbar_headers"></div>
    		<div id="botbody"></div>
    	</div>
    	<div id="content"></div>
    	<div style="clear;both"></div>
    	</div>
    </div>
    </body>
    and the css that needs to change:

    #content {
    float:right;
    margin: 0px;
    padding: 0px;
    background-color: #ECE5DA;
    height: 620px;
    width: 389px;
    border: 0px;
    }

    (added a float and 0'd the margin)

    then add this:

    #mainbody {
    position: relative;
    width:600px;
    }

    You don't strictly need the clearing div, but it can cause problems if not there for any div's you add below.




    Trevor

  3. #3
    SitePoint Addict lundberg's Avatar
    Join Date
    Mar 2003
    Location
    Sweden
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks! it worked perfectly! =)

    Martin Lundberg
    Sweden


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
  •