Accessibility

CSS Advisor

Extra Top Padding in IE 8

by wdtp on August 13, 2009 Avg Rating 4.7 (7)   |   Log in to rate post.

Tagged with sidebar1 , Explorer 8.0 , template , Padding , Explorer 7.0 , !important

Problem

Using a prebuilt Dreamweaver template results in extra top padding in the sidebar1 div in IE8.

Solution

Add the '!important' declaration in the style to force IE to pay attention to the assigned padding values.

Detailed description

Dreamweaver Template used: 2 Column fixed left sidebar header and footer

Code before fix:

.twoColFixLtHdr #sidebar1 {

 float: left; /* since this element is floated, a width must be given */

 width: 200px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */

 background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */

 padding: 15px 10px 15px 20px;

}

 

 

Code after fix:

.twoColFixLtHdr #sidebar1 {

 float: left; /* since this element is floated, a width must be given */

 width: 200px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */

 background: #EBEBEB; /* the background color will be displayed for the length of the content in the column, but no further */

 padding: 15px 10px 15px 20px !important;
 

} 




Text ID: EXTRA_TOP_PADDING_IN_IE_8



Comments (4)

To add a comment, please Log in.




Thank you!

I am rather under time pressure and also had that problem with a DW-layout.
Thank you very much for that hint!

So helpful, yet so simple

Had no idea there was such a command, thank you.

Thanks, very useful!

Googled and found this support page!

Great Information, Simple Solution!

I had really been struggling with this (for days!!) and it was really relieving to find such a simple solution.  Thanks a million!!!!





CSS Advisor home
Submit a post

rss

CSS ADVISOR RSS FEEDS
Recent: POSTS | COMMENTS | EDITS


Browsers
Internet Explorer (103)
Mozilla/Firefox (52)
Opera (18)
Safari (38)
CSS Properties
Background (25)
Border (10)
Color (10)
Float (23)
Font (6)
Margin (11)
Padding (9)
Position (40)
Text (30)
Width/Height (27)