homepage Welcome to WebmasterWorld Guest from 54.197.94.241
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
Nested Div 1 pixel shift
Even worse in Internet Explorer
Robert Poole




msg:3884659
 9:10 am on Apr 3, 2009 (gmt 0)

Hey all

I have the following nested div setup on my page:

<div class="r_bg">
<div class="r_foot">
<div class="r_head">
<div class="r_content">

Content

</div></div></div></div>

In an attempt to put some content in a shaded, rounded corner box. Here's the CSS:

div.r_head {
background-image:url(../gfx/layout/r_header.jpg);
background-repeat:no-repeat;
background-position:top left;
width:251px;
overflow:hidden;
}

div.r_bg {
background-image:url(../gfx/layout/r_bg.jpg);
background-repeat:repeat-y;
background-position:top left;
width:251px;
overflow:hidden;
}

div.r_foot {
background-image:url(../gfx/layout/r_footer.jpg);
background-repeat:no-repeat;
background-position:bottom left;
width:251px;
overflow:hidden;
}

div.r_content {
padding:25px 25px 25px 15px;
width:221px;
min-height:80px;
}

The problem is in both Firefox and IE the footer chunk is shifted 1 pixel to the left (or head and bg 1px to the right depending on your take). In IE in fact, the bg is 1px to the right and the header is a further 1px to the right.

Does anybody know why this is?

... and how to get around it?!

Thanks

 

rocknbil




msg:3884865
 3:00 pm on Apr 3, 2009 (gmt 0)

Did you try zeroing out the margins, and all the padding except the innermost div? Might fix it.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved