x404.co.uk
http://www.x404.co.uk/forum/

CSS menus
http://www.x404.co.uk/forum/viewtopic.php?f=4&t=1178
Page 1 of 1

Author:  tombolt [ Thu Jun 11, 2009 3:40 pm ]
Post subject:  CSS menus

Be gentle with me here, I'm just starting out with this!

I'm trying to create a menu using css. Is it possible to centre a list? It seems that the alignment tools take the bullet into account, even though I've set the list-style-type to none. At the moment, I've just done it by eye using left padding and extending the width of my menu block. I've been doing a lot of searching and I can't seem to find anything that tells me how to do it, but nor can I find anything that says it can't be done. Is it worth carrying on looking for a solution?

Should I be doing it as a list even? Only all the examples I can find seem to have their menus as lists.

Hope that makes sense.

Author:  jonlumb [ Fri Jun 12, 2009 6:46 am ]
Post subject:  Re: CSS menus

Yes, menus as lists is definitely the way forward. Most of the stuff I've done has been using this for creating rollovers, and I've never had any issues with positioning:

http://www.alistapart.com/articles/horizdropdowns/

Personally, I wouldn't centre a menu, it tends to look untidy (to me anyway).

Author:  tombolt [ Fri Jun 12, 2009 9:20 am ]
Post subject:  Re: CSS menus

Thanks Jon, I'll have a look at that. I've managed to get it to work how I want as paragraphs, but I ought to try and do it 'properly'! It's a bit frustrating as I could do what I want so much more easily using html and tables, but I'm determined to give this css stuff a go!

Author:  Nick [ Wed Jun 17, 2009 4:39 pm ]
Post subject:  Re: CSS menus

Why can't you just use text-align: center; on the <a></a> element?? That won't include any space for a bullet.

Author:  tombolt [ Thu Jun 18, 2009 2:33 pm ]
Post subject:  Re: CSS menus

Nick wrote:
Why can't you just use text-align: center; on the <a></a> element?? That won't include any space for a bullet.


Ah, didn't think of that! I've managed to achieve what I wanted as a paragraph anyway, so I can't remember what stage I was at when I asked the question. I'll bear it in mind for next time though, cheers.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/