-
I'm a newbie when it comes to CSS, and i'm struggling with using the positioning tools. I think i've finally got the absolute/relative thing sussed, but i cannot find any method of centering the objects on my page. i know about the 'align=center' command, but i want to centre the div objects themselves on my page, like you do with normal positioning and the 'center' tag. I cannot believe that with all the added functions that CSS brings, there is no way to centre things on a page. I've tried putting everything in a table and then centering that but that didn't seem to work, and anyway i thought the great thing about CSS is that you could scrap things like using tables for layout. I'm having to consider scrapping CSS altogther for my site, which is a real shame. So please help, if anyone knows of a solution, simple or otherwise, please reply. I won't even start with the problems i'm having displaying my page in Netscape... that's a whole separate problem.
-
You can try adding left and right margins to your div tag to center it.
I did that on my personal site and it seems to work well.
I used percentages. I imagine a fixed value would work as well. You can view my stylesheet here.
I'm sure if you look you'll find some errors in the stylesheet, but I'm still learning. http://www.SitePoint.com/forums/wink.gif
hth
Bimjo
-
I dont think it works with all elements, but you can use the 'text-align' feature with some things.
I know it works with TD and Hx
H1{text-align:center;}
I've never tried it on a div, good luck!
------------------
That's just my opinion
t.washington@visto.com
-
Try using TopStyle http://www.bradsoft.com/topstyle/
You can cretae a style sheet ( CSS1) without much knowledge. If yo don't know much about that thing, for example.... font-size
then you view the help file and they explain everything. you can also view the support font-size has on various browsers.
Interface is good. Its perfect for a newbie, even an advanced css user
------------------