...

View Full Version : float within margin 0 auto



BubikolRamios
07-09-2010, 02:57 AM
Obviously need image of flag and text floated left within yellow box.

http://agrozoo.net/jsp/Galery_list_of_specieses.jsp?p1=500

And it turns out good in IE but not in FF and GC.
Any tip ?

skywalker2208
07-09-2010, 04:19 AM
Link doesn't work for me.

Keleth
07-09-2010, 05:42 AM
Any particular reason you float the text? If you want it to appear just right of the flag, give it a left margin.

Also, it doesn't work in IE, nor should it. As the container div has no height (floated content does not contribute to the height of a parent), it appears at its minimum height.

You can add something with a clear at the bottom (<br style="clear: both">) or give the text a left margin instead of floating it, and it'll work fine.

BubikolRamios
07-09-2010, 07:14 AM
It does work in IE 7.0 for me.



give it a left margin.


Or pos absolute ... Then I have to adyust thing on each text change.

The reason: want to nicely verticaly align flags.

EDIT: will try the left margin thing ....

BubikolRamios
07-09-2010, 07:39 AM
Nope. This is how it should look and it does work in ie 7.

http://www.mediafire.com/imgbnc.php/0450185b1f3f3291e32e6ad2c5c876882g.jpg (http://www.mediafire.com/imageview.php?quickkey=rmun3zjfdyj&thumb=5)

abduraooft
07-09-2010, 07:59 AM
Set overflow:auto to that outer div.

PS: Excessive use of inline styles is really very bad!

_Aerospace_Eng_
07-09-2010, 08:03 AM
Nope. This is how it should look and it does work in ie 7.

http://www.mediafire.com/imgbnc.php/0450185b1f3f3291e32e6ad2c5c876882g.jpg (http://www.mediafire.com/imageview.php?quickkey=rmun3zjfdyj&thumb=5)

Yes it does work in IE but it shouldn't. The floats are taken out of flow. It should fail. Any other browser and it doesn't work. They all behave the same except IE. The suggestion of overflow:auto; will work fine. Basically you just need to clear your floats.

BubikolRamios
07-09-2010, 08:55 AM
I give up, doh I designed something acceptable.

overflow:auto - it results, in best case, in img ocupying single line at top.



PS: Excessive use of inline styles is really very bad!


(-: , I allways wait until design looks good.

Kor
07-09-2010, 03:00 PM
(-: , I allways wait until design looks good.
And what might do wrong the CSS classes? You would save a lot of time if using classes instead of local styles.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum