Contact Us

|

FriendFeed FriendFeed

|

follow us on twitter Twitter

|

 Rss Feed

|

Favorites Add to Favorites

Saturday, June 27, 2009

Negative Margin Bug fix in ie6

Developers used to move a blog from its actual position to some other position using negative margin. This will render properly in all the browser except ie6. Basically when you give negative margin, the position of the block will come over the existing block.

For Example:
.bc {
width:100px;
float:left;
}
.abc {
margin-top:-100px;
}

In the above example, .abc block will be over the .bc block. But in ie6 .bc block will be over than the .abc block and .abc block will get hidden. Here is a simple hack to display the block on top.

How to use:
.abc {
margin-top:-100px;
position:relative;
}

Just add position relative to negative margin when using it. This simple hack will work in all the browsers.

Labels: , ,

15 Comments:

Anonymous Anonymous said...

Thanks :)

December 26, 2009 at 8:53:00 AM PST  
Anonymous Anonymous said...

Perfect - thanks

January 27, 2010 at 8:45:00 AM PST  
Anonymous Anonymous said...

excellent. saved my day

May 3, 2010 at 3:51:00 AM PDT  
Anonymous Anonymous said...

thank you very much

May 26, 2010 at 4:25:00 AM PDT  
Blogger Cao said...

That was poetry. Thanks!

June 6, 2010 at 7:10:00 PM PDT  
Anonymous Anonymous said...

Thank you very much

August 29, 2010 at 9:58:00 AM PDT  
Anonymous Anonymous said...

You just saved me some time too! Props to you :)

August 30, 2010 at 12:47:00 PM PDT  
Blogger Unknown said...

Sick! Thanks, this works a charm.

September 27, 2010 at 12:33:00 AM PDT  
Anonymous Anonymous said...

"That was poetry". Awesome!

October 14, 2010 at 1:33:00 AM PDT  
Anonymous Anonymous said...

Thanks a lot! I've killed about an hour with this bug!
==
wd

December 23, 2010 at 7:53:00 PM PST  
Anonymous Anonymous said...

Brilliant - thanks

February 13, 2012 at 12:35:00 AM PST  
Anonymous Anonymous said...

Thank you a lot :)

May 8, 2012 at 11:25:00 PM PDT  
Anonymous black_princess said...

excellent post! this is the kind of information that should be shared across the internet. keep it going! Kudos :)

www.n8fan.net

July 15, 2014 at 11:17:00 PM PDT  
Anonymous Anand said...

Thank you so much!

January 29, 2015 at 3:29:00 AM PST  
Blogger joemill00077711 said...

?I was very happy to find this net-site.I wanted to thanks in your time for this glorious read!! I definitely having fun with every little bit of it and I have you bookmarked to take a look at new stuff you weblog post. mgm online casino

June 19, 2018 at 5:35:00 AM PDT  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home