Styling lists
Posted: Sat, 2008-10-11 15:18
Why is my list centered in my menu. I want it to be further left. I tried to use text-indent:-15px but it only works for the first line. If there is a second line it get's centered.
Here's the site fornoreason.com/reboot
Any suggestions,
Thanks,
Joe


Guru
Posts: 2834
Joined: 2004-09-01
Location: MA, USA
you haven't zeroed the
Posted: Sat, 2008-10-11 15:34
you haven't zeroed the margin or padding. By default browsers use one or the other to indent lists.
Regular
Posts: 19
Joined: 2008-04-14
It didn't work :(
Posted: Sat, 2008-10-11 15:49
Thanks wolfcry,
I appreciate the help. Works great!
One question though. I zeroed the margins in the body tag of default.css. Do lists not inherit this property? What else doesn't inherit?
Thanks again,
Joe
Leader
Posts: 847
Joined: 2008-02-04
Location: Netherlands
I dunno who else doesn't
Posted: Sat, 2008-10-11 16:57
I dunno who else doesn't inherit, however there is a way to zero everyone: The universal reset.
* {
margin: 0;
padding: 0;
}
The thing to be careful about this is, it also strips padding from form controls, and as browsers are picky about forms, some don't let you add the padding back (and your forms will looks goofy stoopid in them like Opera). Also the submit buttons don't have the same focus or active states for some reason.
These are small issues but they can be important re accesssibility with forms for some users. When I have forms on a site, then I keep the margin in the universal reset, and then list all my blocks that are on that site to remove the padding. I think this is bloaty to the max but browsers don't currently support the "except" (not) CSS3 stuff : (
I'm no expert, but I can fake one on teh Interwebz
Regular
Posts: 19
Joined: 2008-04-14
Awesome, I didn't know
Posted: Sat, 2008-10-11 16:59
Awesome,
I didn't know there was a universal selector.
Thanks for your help,
Joe
Leader
Posts: 847
Joined: 2008-02-04
Location: Netherlands
There're all sorts of weird
Posted: Sat, 2008-10-11 17:09
There're all sorts of weird stuff out there! Just wait til you see stuff like this in everyday webpages:
a[href*="wikipedia"] {
do some funky stuff;
}
Any link which has the word "wikipedia" anywhere in the href gets that funky style. All other anchors don't get it. It doesn't matter where in the url the work "wikipedia" is.
Of course, this doesn't work with IE6 : )
I'm no expert, but I can fake one on teh Interwebz