Click to See Complete Forum and Search --> : Absolute positioning
Jenuine
12-06-2004, 09:58 PM
I was told this was a CSS problem:
I need to use "absolute position" for a couple of objects. I would like them to be centered on the page, one on top of the other (the one on top is movable, so I have to use absolute position...(I have the "movable" part done). How do I do this to make them centered on any screen. When I looked at the site at home, the objects were centered exactly where I wanted them, but when I looked at it from another computer, they weren't.
Please help.
Jupac
12-06-2004, 10:01 PM
.center{
postiton:absolute;
top:50%;
left:50%;
Jenuine
12-06-2004, 10:18 PM
Thanks, lakers...That seemed to work, but now I have a problem with the positioning of everything else on the page.
If you want to look at http://imsinet.casa.siu.edu/jen_k/Showcase/Home.htm to see my dilema, you may.
I was using a table originally, and haven't taken that out. Should I remove the table altogether, and just go with absolute positioning of everything on the page (even the text)? If there's a better way, I'd love to know what it is.
Jupac
12-06-2004, 10:18 PM
Yes you should take out the tables. They arnt mennt to be used for layouts
Jenuine
12-06-2004, 10:23 PM
wow...thanks for the quick response.
I will take out the table, but is there something else I should use instead to keep everything aligned?
Jupac
12-06-2004, 10:25 PM
put them all in to like a wrapper
Jenuine
12-06-2004, 10:28 PM
Please bear with me...I'm learning as I go here.
What do you mean by "wrapper"?
Jupac
12-06-2004, 10:34 PM
well like
#wrapper{
height:blah;
border:1px solid #000;
}
<div id="wrapper">
//your stuff
<div>
Jenuine
12-06-2004, 10:47 PM
I tried it, but I must not be positioning the code in the right places because no matter where I put:
#wrapper{
height:blah;
border:1px solid #000;
}
It shows up when I preview it (I replaced "blah" with a number). I tried it both in the head and in the body.
Jupac
12-06-2004, 10:49 PM
put it in the header
<style type="text/css">
#wrapper{
height:blah;
border:1px solid #000;
}
</style>
Jenuine
12-06-2004, 10:56 PM
Thank you....That worked (although I changed the border to 0px because I didn't like having a border all the way around.
Now to conquer the next problem of aligning everything up all nice and neat. Do I use "absolute position" for everything? Or what would be the best way to attack this?
Jenuine
12-06-2004, 10:58 PM
I changed the border back to 1px and took the " solid #000 " out.
Jenuine
12-06-2004, 11:00 PM
My airplane is acting funny now, too. It doesn't stay right with the mouse now.
Jupac
12-06-2004, 11:01 PM
you need type and color
so
solid , dashed , dotted
and color any one u like
Jenuine
12-06-2004, 11:09 PM
Ok...I changed it to a nice light gray color...that I can live with. :D
However, it didn't fix my alignment problem or the fact that my airplane isn't staying right with my mouse. :(
Jupac
12-06-2004, 11:25 PM
Btw i cant move the plane with FF only in IE
Jenuine
12-06-2004, 11:30 PM
I'm not familiar with FF, and I'm not sure how to make the program compatible with all browsers. Chances are, the only one's who are going to be looking at this will be using IE...but if you have any suggestions as to how to make it compatible with other browsers, I would gladly welcome the input.