2 replies [Last post]
Rischen
Offline
Regular
Johannesburg
Last seen: 18 years 11 weeks ago
Johannesburg
Joined: 2004-11-20
Posts: 43
Points: 0

Hi,

How do you make the text in an unordered list the family, color, etc. you want? I don't know whether it's just me but my list keeps on coming out in Times but I've got <p> as arial.

On a related tip-- How can you remove the default margin that a list has that makes it step out an em or so from the page or div margin? I've got a list that I'd like flush down the left border of a central column div and I can't seem to get rid of that default padding.

I appreciate your time,

Rischen

wisbin
Offline
Enthusiast
Netherlands
Last seen: 18 years 15 weeks ago
Netherlands
Joined: 2004-10-28
Posts: 71
Points: 0

Re: list formatting

Rischen wrote:

How do you make the text in an unordered list the family, color, etc. you want? I don't know whether it's just me but my list keeps on coming out in Times but I've got <p> as arial.

The css styling for <p> only affects the <p> elements. If you want to hit the <ul> or <li> add a font-style to them. And if you unwillingly get screwed up by the cascade, you can add some !important before the style definition end ;

Rischen wrote:

How can you remove the default margin that a list has that makes it step out an em or so from the page or div margin? I've got a list that I'd like flush down the left border of a central column div and I can't seem to get rid of that default padding.

You can try the list-style : none; and list-style-position: outside; i think.

We could be more helpfull if you add link to a test.html with the css in action.

good luck.

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 1 year 49 weeks ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9776
Points: 3858

list formatting

li {
    font-family: arial, sans-serif;
    }

ul {
    margin: 0;  /*IE uses margin*/
    padding: 0; /*Moz uses padding*/
    }

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.