Results 1 to 4 of 4
  1. #1
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default Help with the simplest code ever!

    CSS

    HTML Code:
    div.header_left_green {
    	width: 10px;
    	height: 29px;
    	background-color: blue;
    	float: left;
    	position: relative;
    }
    
    div.header_mid_green {
    	height: 21px;
    	background-color: red;
    	margin-left: 10px;
    	margin-right: 10px;
    	position: relative;
    	padding-top: 8px;
    }
    
    div.header_right_green {
    	width: 10px;
    	height: 29px;
    	background-color: pink;
    	float: right;
    	position: relative;
    }
    HTML:

    HTML Code:
    <div class="header_right_green"></div>
    <div class="header_left_green"></div>
    <div class="header_mid_green"></div>
    Firefox / Chrome:

    IE:


    I don't understand why IE isn't adding the height & top padding together, and why its adding the gaps on the left & right :S

  2. #2
    Join Date
    Mar 2009
    Posts
    6
    Tokens
    0

    Default

    Do you have this at the top of your script?

    HTML Code:
    <!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    That should fix it.

  3. #3
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default

    hehe, just released I forgot to add this:

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  4. #4
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    If you take away the width for padding in firefox, make a note of the original size with a . infront of it (so .width: 250px; or something like that) that will tell IE thats the actual size while firefox ignores it.

Posting Permissions

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