css with <ul>

B

Bruno

Hi there,

I want to format a unsorted list with
ul { margin-left: 0; margin-bottom: 0;margin-top: 0;
font-family: Arial;font-size: 90%; }

however, doing this, I do not get the "bullets" any more. What am I doing
wrong?

Regards

Bruno
 
E

Els

Bruno said:
Hi there,

I want to format a unsorted list with
ul { margin-left: 0; margin-bottom: 0;margin-top: 0;
font-family: Arial;font-size: 90%; }

however, doing this, I do not get the "bullets" any more. What am I doing
wrong?

The bullets are probably to the left of the list, outside your view.
Try li{list-style:inside;}
 
B

Bruno

Great! it works!

But another effect occured: now all list items, even sub - list Items begin
at the same vertical line. What I am really looking for is the following:

normally, the list starts some milimeters to the right of the left edge. I
want it to start just at the left edge (of a cell). Sub list items should be
inserted a little bit to the right. How can I do this?

Regards
Bruno
 
E

Els

Bruno said:
Great! it works!

Please show your gratitude by replying below the message parts you are
replying to ;-)
But another effect occured: now all list items, even sub - list Items begin
at the same vertical line. What I am really looking for is the following:

That's because you said ul{margin-left:0;}.
normally, the list starts some milimeters to the right of the left edge. I
want it to start just at the left edge (of a cell). Sub list items should be
inserted a little bit to the right. How can I do this?

What you want is for instance:
ul{margin-left:0;}
ul ul{margin-left:10px;}
 
M

Mike Massonnet

Bruno said:
Hi there,

I want to format a unsorted list with
ul { margin-left: 0; margin-bottom: 0;margin-top: 0;
font-family: Arial;font-size: 90%; }

however, doing this, I do not get the "bullets" any more. What am I doing
wrong?

Regards

Bruno

perhaps with padding-left:12px
bye
 
T

Toby Inkster

Els said:
What you want is for instance:
ul{margin-left:0;}
ul ul{margin-left:10px;}

Argh! How many times do I have to say it?!

Different browsers use different combinations of margin and padding on UL
and LI to each achieve roughly the same effect. (An indentation of about
1.5em, followed by a bullet point, then an indentation of about 1em.)

Whenever you set a margin or padding on a list or list item, you must set
them all!

UL { margin: AAA; padding: BBB }
UL LI { margin: CCC; padding: DDD }

for whatever values AAA, BBB, CCC and DDD that you want.
 
E

Els

Toby said:
Argh! How many times do I have to say it?!

To me? This would be the last time - sorry! <g>
To the rest of the world? Better make a tutorial and memorize the url
;-)
Different browsers use different combinations of margin and padding on UL
and LI to each achieve roughly the same effect. (An indentation of about
1.5em, followed by a bullet point, then an indentation of about 1em.)

Whenever you set a margin or padding on a list or list item, you must set
them all!

UL { margin: AAA; padding: BBB }
UL LI { margin: CCC; padding: DDD }

for whatever values AAA, BBB, CCC and DDD that you want.

All true :)
(I always set all padding and margins on both ul and li to 0 before I
start styling them, but I forgot to pass that on in my reply)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top