Positioning an li

C

C A Upsdell

The other problem is that I wish to reduce the spacing between the li

The specs do not describe how markers (e.g. bullets) should be positioned,
leaving this up to the browser maker. So positioning the marker depends on
the browser. What I do (arggghhhh!) is use JS to generate different CSS for
different browsers.
 
T

Toby A Inkster

C said:
What I do (arggghhhh!) is use JS to generate different CSS for
different browsers.

Why?

Just start with a base of:

ul, ol, li {
margin: 0;
padding: 0;
list-style: none inside;
}

and then build.
 
C

C A Upsdell

Toby A Inkster said:

Because different browsers need different CSS to obtain comparable results.
E.g. on a site I just re-built:

For Gecko-based browsers:
ul li { margin:0 0 0 -2ex; padding:0 0 0.5ex 0; }

For IE6:
ul li { margin:0 0 0 2em; padding:0 0 0.5ex 0; }

For Opera 7:
ul li { margin:0 0 0 2em; padding:0 0 1ex 1ex; }

I repeat: the specs do not prescribe how the marker should be positioned,
or the LI indents controlled, leaving this up to the browser maker. And
different browser makers have made different choices ... even for different
versions of their browsers.
 
S

Steve Pugh

C A Upsdell said:
Because different browsers need different CSS to obtain comparable results.
E.g. on a site I just re-built:

For Gecko-based browsers:
ul li { margin:0 0 0 -2ex; padding:0 0 0.5ex 0; }

For IE6:
ul li { margin:0 0 0 2em; padding:0 0 0.5ex 0; }

For Opera 7:
ul li { margin:0 0 0 2em; padding:0 0 1ex 1ex; }

I've just tried the above and the first set of styles in Gecko does
not match the second set in IE. And neither match teh third set in
Opera.

OTOH, the first set looks the same in all three browsers, ditto for
the other two sets.

Do you have some other styles (such as for ul) as well?
I repeat: the specs do not prescribe how the marker should be positioned,
or the LI indents controlled, leaving this up to the browser maker. And
different browser makers have made different choices ... even for different
versions of their browsers.

That is true. But have a look at
http://steve.pugh.net/test/test37.html

Steve
 

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
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top