Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Yet another IE float issue
Old 11-12-2009, 05:05 PM Yet another IE float issue
Junior Talker

Posts: 1
Name: Nick
Trades: 0
Hello, all -

I've been banging my head agaist this one for a while. I've tried many of the suggested float-fixes for IE and nothing seems to help. Any suggestions appreciated!

The issue is this: When pages are loaded in IE which have float:right elements (photos inside divs), they briefly position themselves correctly, then the margin-left value (10px) goes away and they are snug up against the text. An example is here:

http://pandora.cii.wwu.edu/showcase2.../portfolio.asp

If you refresh a couple times while watching one of the pictures on the right hand side, you (might) see what I mean (hopefully).

If not, and this is the weird part, open up the developer toolbar, select one of those float:right boxes, uncheck either the margin or the float property, then re-check it. The problem goes away. Why, oh why, oh why...

Thanks again.

Nick, WWU
icurays1 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-12-2009, 08:15 PM Re: Yet another IE float issue
vangogh's Avatar
Post Impressionist

Posts: 10,688
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
I can't check IE right now, but I think I know roughly what's going on. IE7 and below has what's known as the double float bug or double margin bug. I don't think IE8 has the issue, but I think IE7 does.

When you float an element in one direction and also have a margin in the same direction IE doubles that margin. In your case you're floating an element right and I assume that same element has a margin-right applied to it. At first your page loads fine, but then when the doubled margin gets applied your elements gets pushed to the left.

There's a simple fix. Add display: inline to the element. Your element will still be a block level element, but it should fix the problem. Another option is to use conditional comments to half the margin for IE only. display: inline is the easier fix.

If that doesn't work then it's a different problem.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 11-13-2009, 04:03 PM Re: Yet another IE float issue
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Steve hit the nail on the head, it's the doubled-float margin bug - you've got a right margin applied to a right-floated div - IE doubles the margin.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Yet another IE float issue
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16652 seconds with 12 queries