which is best?
best way to postion a div (and most practical) what do you choose?
(css2, displays correct in FF and 6.5)
margin: 10 0 0 10;
(css1, need hack for IE)
i know i have asked this before, but didnt get a clear answer at the end as to which is the best to use (i know they display the same)
going to be postioning divs alot in this project and want to do it right!
Margins are often better.
6.5? What's 6.5?
You need to use units unless the number is 0.
Why would you need a hack for IE?
It really just depends on where you want it...
as I don't think there are many 'semantics'
issues w/ css except to compact the code as
much as you can!
Padding works well, as does position:relative;
[which tweaks an element from its orig. posit.
in the flow] but margins are best, as K. stated.
Keep in mind the nagging browser differences
and then lay them out to best suit the project - -
In case anyone didn't know -
top:value; and left:value; wouldn't work w/out a position:relative; or position:absolute; as part of the properties for that element - and units are
needed with the values ;-)
Last edited by LJK; 12-12-2005 at 07:00 PM.
hi guys thanks for your answers
6.5 was ment to be IE6.5 forgot to write ie sorry! why would i need a hack? because ie and ff interpert the margins different dont they? i have used it and came out different.
good points there!
mozilla, opera, and internet explorer render magins similarly
although i have found that for the body element in opera it uses padding instead of margin
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)