SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: Trouble with aligning in IE
-
Oct 23, 2004, 07:34 #1
- Join Date
- Mar 2004
- Location
- West Midlands, United Kingdom
- Posts
- 2,631
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Trouble with aligning in IE
I have been playing around with this layout!
I have not done much in CSS and was wandering if someone could explain why its positioned where it should be in firefox but not in IE?
Thanks
-
Oct 23, 2004, 08:07 #2
- Join Date
- Jan 2003
- Location
- Hampshire UK
- Posts
- 40,556
- Mentioned
- 183 Post(s)
- Tagged
- 6 Thread(s)
Hi,
Ie has a double margin bug on the side of a float nearest the windows edge or its parent containers edge and the margin on that side gets doubled.
The fix is to ad display-inline to the offending element and causes ie to render the correct margin (for some unaccountable reason).
The display-inline is totally safe because floats are block level by default and cannot be changed by css. Therefore other browsers that understand the specs ignore the display:inline.
Code:#contentbox1{ background-image: url('http://www.protemplates.ws/blog/images/blog.gif'); background-repeat: no-repeat; float: left; padding-left: 2px; width: 160px; height: 253px; color: #CCC; text-align: justify; font-family: verdana; font-size: 0.8em; margin-left: 10px; margin-right: 16px; display:inline; }
Paul
-
Oct 23, 2004, 08:37 #3
- Join Date
- Mar 2004
- Location
- West Midlands, United Kingdom
- Posts
- 2,631
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks Paul, Brilliantly put
Makes sense now!
Cheers!
Bookmarks