Results 1 to 4 of 4

Thread: Setting Horizontal Div's - FF works but IE doesn't

  1. #1
    Join Date
    Mar 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Setting Horizontal Div's - FF works but IE doesn't

    Hello everyone,

    First post on here. I was looking around but couldn't find an answer to my problem so I was hoping someone here might be able to help.

    Here's the problem. I'm trying to set two div's horizontally. The two are wrapped in a container div.

    Firefox is displaying correctly however internet explorer is pushing the rightmost div all the way to the right and putting the contents on multiple lines. This is also causing the rest of the page to degrade terribly.

    Here's the CSS:
    Code:
    #header_login {
    	background: #ff0000;
    	height: 50px;
    	width: 980px;
    	border-left: 10px solid #ccc;
    	border-right: 10px solid #ccc;    
            margin: 0px;
    	clear: right;
    	}
    #header_login_content_left {
    	height: 48px;
    	width: 350px; 
    	padding: 10px;
    	float: left;
    	}
    #header_login_content_right {
    	height: 48px;
    	width: 550px; 
    	padding: 12px;
    	float: left;
    	}
    and this is the implementation of it:

    Code:
    <div id="header_login">
      <div id="header_login_content_left">
        ...content here...
      </div>
      <div id="header_login_content_right">
        ...content here...
      </div>
    </div>
    I'm learning CSS on my own and still don't know nearly everything so maybe it's a basic error but if anyone could help it'd be MUCH appreciated!

    Chris

  2. #2
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    What you have to take into account is how IE renders padding; it counts the padding as PART of the width and height. So, try subtracting the padding from the width and height and see what that does in IE. I suggest maybe using IE Conditionals, actually, as it currently works in Firefox.
    Thou com'st in such a questionable shape
    Hamlet, Act 1, Scene 4

  3. #3
    Join Date
    Mar 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by alexjewell View Post
    What you have to take into account is how IE renders padding; it counts the padding as PART of the width and height. So, try subtracting the padding from the width and height and see what that does in IE. I suggest maybe using IE Conditionals, actually, as it currently works in Firefox.
    Hi - thanks for the help. I set the padding at 1px for both header_login_content left and right.

    Firefox is still handling it correctly, safari and ie are messing with content right and stacking it on top of each other.

    Here's a test site: www.zreloaded.com

  4. #4
    Join Date
    Mar 2008
    Posts
    218
    Thanks
    7
    Thanked 19 Times in 19 Posts

    Default

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title>zreloaded</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <style type="text/css">
    <!--

    #header_login_content_left {
    position: absolute;
    width: 14em;
    left: 1em; }

    #header_login_content_right {
    margin-left: 10em;
    }
    -->
    </style>
    </head>

    <body>
    <div>
    <div id="header_login_content_left">
    ...content 1 here...
    </div>
    <div id="header_login_content_right">
    ...content 2 here...
    </div>
    </div>
    </body>
    </html>

    maybe this is helpfull. I removed your header because i don't think there is need for that.

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
  •