virtual Posted January 13, 2010 Report Share Posted January 13, 2010 I just read an article where the author states When you have odd issues between browsers where elements vanish, don?t show or are a few pixels out of alignment, it?s normally because you are guilty of using margin and padding for positioning your elements. This is wrong because margin and padding were not designed to do that.Positioning comes in 4 flavours: static, relative, absolute and fixed. I was rather surprised that he didn't mentioned floats as I regularly use static position (undeclared) and floats and very rarely the others. I usually don't have major problems with positioning, except for the usual IE bugs, and I just wondered what sort of positioning you guys use on a regular basis? Is there a prefered method or is it just a matter of personal choice? Quote Link to comment Share on other sites More sharing options...
jlhaslip Posted January 13, 2010 Report Share Posted January 13, 2010 I rarely use position absolute or relative. Generally use floats, margin and padding. Quote Link to comment Share on other sites More sharing options...
Wickham Posted January 13, 2010 Report Share Posted January 13, 2010 Same here; I start by styling divs without any position, using floats and margins and often the whole page can be like that. I only use position: relative where I have to use position: absolute elements inside for some reason (perhaps layering over something else) and they need to relate to the top left corner of the position: relative parent, and also where I need something like a drop down menu to show over a flash or javascript image and position: relative plus a z-index is necessary. Quote Link to comment Share on other sites More sharing options...
virtual Posted January 13, 2010 Author Report Share Posted January 13, 2010 @Wickham and Jim Thanks for the insight, that's exactly how I code too. I have been helping out on another forum, the article I read was from one of the mods, and I noticed that most of the CSS questions are problems due to the relative positioning and of course lack of validation. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.