SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast thekiwi's Avatar
    Join Date
    Apr 2004
    Location
    New Zealand
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MSIE and DIV width

    Hi

    Have various minor issues with MSIE and a CSS based site Im developing.

    I have the following code for displaying "headers" for various sections:
    Code:
    div.contentheaderorange{
    	display:block;
    	margin:0px 0px 0px 0px;
    	padding-left: 0px;
    	padding-right:0px;
    	padding-top:0px;
    	height:27px;
    	background-image : url(/images/tabs/orangehead_topright.gif);
    	background-repeat : no-repeat;
    	background-position : top right;
    }  
    
    div.contentheaderorange h2{
    	font-size:1.1em;
    	color:white;
    	padding-left:10px;
    	padding-right:10px;
    	padding-bottom:0px;
    	padding-top:5px;
    	margin-bottom:0px;
    	margin-top:0px;
    	background-image : url(/images/tabs/orangehead_topleft.gif);
    	background-position : top left;
    	background-repeat : no-repeat;
    }
    This is used with the following HTML, eg:
    Code:
      <div class="contentheaderorange">
    	<h2>Featured Items</h2>
      </div>
      <div class="contentbody">
       <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. .</p>
      </div>
    The trouble is, the "contentbody" has a silver border around it, and in MSIE the border doesnt line up with the edge of the "header" above it. It works OK in NN, Firefox, Opera, Mozilla.
    If I change the CSS to be something like:
    Code:
      display:inline;
      float:left;
      width:100%
    works great in MSIE6, but fails in MSIE5, in that it now floats below my other DIVs on the page.
    Ive tried adding width:inherit around it all, but no luck.

    Any ideas would be greatly appreciated ... otherwise, I'll have to live with MSIE having the silver border slighjtly misaligned.

    You can view it at http://iiw.infobahn.co.nz/

    Cheers

    Craig

  2. #2
    SitePoint Enthusiast thekiwi's Avatar
    Join Date
    Apr 2004
    Location
    New Zealand
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm .... if I remove the "height:27px;" form the CSS, everything lines up.???
    Cheers

    Craig


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
  •