[WSG] pos- relative or margin?
Hi, I want to know which is the best method. I have seen a page where all the divs are positioned with position relative and with top , bottom attributes instead of margin.. Is this a good method? There is no browser compatibility issues while using this where as when using margin properties IE has probelms.. Pls advice. thanks and regards Naveen Bhaskar Bangalore Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/ *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: memberh...@webstandardsgroup.org ***
Re: [WSG] pos- relative or margin?
Using top and left properties in positioning is fine; using rel, pos+, and absolute positioning for columns can actually be better than using floats in that objects that expand past the width of a floated object will not disrupt the layout of the page by bumping nearby floats down the normal flow of the document. —Pascal On 08/01/2009, at 9:26 PM, Naveen Bhaskar wrote: Hi, I want to know which is the best method. I have seen a page where all the divs are positioned with position relative and with top , bottom attributes instead of margin.. Is this a good method? There is no browser compatibility issues while using this where as when using margin properties IE has probelms.. Pls advice. thanks and regards Naveen Bhaskar Bangalore Add more friends to your messenger and enjoy! Invite them now. *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: memberh...@webstandardsgroup.org *** --- Simon Pascal Klein Concept designer (w) http://klepas.org (e) kle...@klepas.org *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: memberh...@webstandardsgroup.org ***
Re: [WSG] pos- relative or margin?
Naveen Bhaskar wrote: I have seen a page where all the divs are positioned with position relative and with top , bottom attributes instead of margin.. Is this a good method? Depends entirely on the actual layout. I often use both relative offset and margin push/pull on the same elements. Position relative doesn't move the element, only offset it visually - the element still takes up space in its original, non-positioned, position. Margins affects the element's actual position. When used on floats margins can remove the element-space partly or entirely. There is no browser compatibility issues while using this where as when using margin properties IE has probelms. IE6 has serious problems with position relative in certain combinations, but provoking bugs with margins isn't a problem either in that old bugger. IE7 is better but far from flawless. IE7 and older introduce positioning and margin problems related to 'hasLayout'[1], where the cure for one bug often causes more problems than the disease. regards Georg [1]http://www.satzansatz.de/cssd/onhavinglayout.html -- http://www.gunlaug.no *** List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: memberh...@webstandardsgroup.org ***
Re: [WSG] pos- relative or margin?
People use position:relative instead of margins to help avoid margin collapse. Here's some links in case you aren't familiar with margin collapse. http://www.w3.org/TR/CSS2/box.html#collapsing-margins http://www.andybudd.com/archives/2003/11/no_margin_for_error/ Michael Turnwall for all your web code needs turnwall.net Gunlaug Srtun wrote: Naveen Bhaskar wrote: I have seen a page where all the divs are positioned with position relative and with top , bottom attributes instead of margin.. Is this a good method? Depends entirely on the actual layout. I often use both relative offset and margin push/pull on the same elements. Position relative doesn't move the element, only offset it visually - the element still takes up space in its original, non-positioned, position. Margins affects the element's actual position. When used on floats margins can remove the element-space partly or entirely. There is no browser compatibility issues while using this where as when using margin properties IE has probelms. IE6 has serious problems with position relative in certain combinations, but provoking bugs with margins isn't a problem either in that old bugger. IE7 is better but far from flawless. IE7 and older introduce positioning and margin problems related to 'hasLayout'[1], where the cure for one bug often causes more problems than the disease. regards Georg [1]http://www.satzansatz.de/cssd/onhavinglayout.html ***List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfmUnsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfmHelp: memberh...@webstandardsgroup.org***