Hi, I was wondering I usually use floats and so on, but I have an object (video player), which is in a set position regardles of whatever happens, therefore it's a lot easier just to position it on the page say 300px from the top and 30px from the left. Would this cause any problems with any browsers? Many thanks in advance to any opinions on abs positioning
I don't think it should cause too many, if any, problems. Just remember to z-index stuff around it so that it doesn't get covered by anything.
Having just that should be fine, Only problems you mostly get with absolute positioning is browser compatability as you already said, If you have some other browsers installled you can check it yourself
z-index is the layer on the page...if you make it z-index 500 it'll always be on top of the other things on the page. Floats are easy to make cross-browser compatible, absolute positioning is less so.
Thanks for the replies. Grit if you have two elements which overlap each other on your page, then you can use Z-Index to choose which element appears on top. So if you give one element a Z-index of 100, and another a Z-index of 5, and say they overlap due to positioning or whatever the one with a Z-index of 100 would appear over the top. Is the following possible with positioning? A DIV 30px from the top done by positoning, but 500px from the left, and re-sizes with the browser window, so takes up all remaning space apart from 500px gap on the left?
Well this is what i'm trying to achieve. DIV 1 is about 500px DIV 2 is about 50px and floated next to DIV A, you can ignore it really. DIV 3 I want to be 100% (of remaining space that is) and next to 2. However I don't want 3 to be floated, rather positoned. Because 1 can be enlarged via Javascript, and should simply overlap 3. floats will cause 3 to drop to the next line rather than it overlap. So how do I abs position 3 as in the diagram, taking up 100% of width but with a 550px left margin? Live-cms you can't set 100% width, because then the width of the DIV is 100%+550px.
Absolute positioning is not at all Bad. Some people say Floats are bad, some say absolute positioning is bad. But the real thing is not knowing both these very well is bad and that is what creates problems. One should know how floats and absolute positioning works and what it should be used for. Then only these will prove a boon instead of creating problems. Half knowledge is dangerous. and using absolute positioning where it is not required create problems for sure.