homepage Welcome to WebmasterWorld Guest from 54.205.242.179
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: DrDoc

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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved