Page 1 of 1

CSS MENUS

Posted: Sun Jan 04, 2004 5:39 am
by ptysell
I have created a custom CSS menu for a web site. This menu only uses CSS. I know that i probably did not do this correctly but it does work how i would like(tested in Mozilla 1.5.1 and Safair 1.1.1)

I am having trouble figuring out how to align the main tab text to the center.

One of the problems that i am having is that i am currently learning CSS an am not sure if i did everything correctly, especially with stuff like ul.whatever:link or whatever ul:link or ul.whatever a:link and what not.

I am almost sure that i did not code this correct and any guidence would be nice.

you can check out the code at
XHTML: http://www.a2t.org/ptysell/xhtml/menu.html
CSS: http://www.a2t.org/ptysell/xhtml/menu.css

Thanks

Posted: Mon Jan 05, 2004 12:13 am
by Gen-ik
Ok, first of all your links aren't going to work in a lot of browsers.
In order to set a link style to a certain object/id you need to use this syntax (replace myID with the id of the object)...

div #myID a:link { color:#ff0000; }
div #myID a:hover { color:#0000ff; }


If you are setting the link style using a class name and not an ID then use this syntax (replace className with the erm, class name)...

div.className a:link { color:#ff0000; }

To align text so that it appears in the center of a div (or anything else) you can use text-align:center...

div #myID { text-align:center; }
div.className { text-align:center; }



Hope that helps.