Question:
CSS Positioning?
curious
2007-07-18 22:09:57 UTC
Curious. Still learning CSS positioning. This may sound dumb but I saw this code on a post.








Parent
I'm absolute right

I'm absolute left

I'm relative right

I'm relative left














My question is, when you are trying to layout everything. how do you determine like right: 200 left : 200 to position everything. i have my rulers visible in Dreamweaver but it just seems like you have to keep playing with numbers until you finally get it positioned right. This can take alot of time. Is there another way around this that I just havent tapped into yet.

Thanks
Three answers:
anonymous
2007-07-18 22:36:47 UTC
I can't answer definitively without seeing what you're working on, because the position of layers depends to some degree on the containing elements it's inside.



For example, if you have a large margin on the body, an absolute position of 200px won't be the same as an absolute position of 200px if the body has a small or no margin.



The same is true if the given DIV is inside other DIVs. Although you are specifying an absolute position, the position is only absolute given the margins of any containing elements.



That's an even bigger issue when using relative positioning, which is further dependent upon the height and width of containing elements.



In short, your point -- that more often than not, Mark I Eyeball is the way you position things -- is generally true.



As you get better, you'll know how to set things up so less trial and error is needed.
Archer
2007-07-19 00:20:38 UTC
hello, that code is one of my answers to a previous question. the numbers there are just random. I had nothing particular in mind when i put those in.



to answer your question, you must remember that a positive integer will move the object opposite its description from point of reference:



position relative, left moves the object right

relative, top moves it down



as the 1st reply said, most of the time you 'eyeball' the position. but since you have rulers it might help you to know that 1 inch is equal to 96px
?
2016-11-10 01:54:10 UTC
Which version of IE does you have, set up IETester to examine your internet site on diverse variations of IE. further there are hacks available to paintings around with positioning in IE.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...