Guest orthodoxkohen Posted February 26, 2008 Share Posted February 26, 2008 I hope there's a solution to mixing fluid widths and containers. I've tried centering a text within a left or right floated div to no avail. Please let me know of your methods. Link to comment Share on other sites More sharing options...
S@m Posted February 26, 2008 Share Posted February 26, 2008 element {text-align:center;margin:0 auto;} Link to comment Share on other sites More sharing options...
Jack McKalling Posted February 27, 2008 Share Posted February 27, 2008 Floating elements is originally meant for positioning images inside paragraphs as to let the text wrap around it, not for horizontal aligning block elements.Notice that float will work in IE, but using other browsers you'll get unexpected problems. That Internet Explorer allows elements to be floated left or right of other elements by using float, does not mean it is correctly interpreting that property. In other browsers it will actually result in the floated element taking part of the width of its parent, not apearing next to but inside it :)Having said that, centering text in a floated element could result in something completely different to what you originally meant, because of this special definition of a "floated element" Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.