...

View Full Version : display:list-item



jeorg
11-28-2002, 12:16 PM
this code do not work

-------------------------------------------------------------

<?xml version="1.0" encoding="iso-8859-1"?>
<!doctype html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<style type="text/css" >
div
{display:block;}
span.L
{display:list-item;list-item-type:disc;}
</style>
</head>
<body>
<div>
<span class="L">A</span>
<span class="L">B</span>
<span class="L">C</span>
</div>
</body>
</html>

---------------------------------------------------------

I get a list but no disc

do you know hy ?

MCookie
11-28-2002, 01:16 PM
Shouldn't that be: list-style-type:disc;?

Also, Win/IE6 needs to see a DTD on the first line of your page. If it's not there, it renders your page in quirks mode. So better take out the xml declaration? It's not required anyways.

And, by the way, a div is a block level element by default. You don't need the
div {
display:block;
}

jeorg
11-28-2002, 02:51 PM
with or without the result ís the same , it doesn't work

MCookie
11-28-2002, 04:17 PM
Then it's probably not supported by IE yet..
I only use none/block/inline for the display property. Support for anything else doesn't exist or is buggy.

jeorg
11-28-2002, 04:46 PM
same thing for Mozilla and opera ....it doesn't work

jkd
11-28-2002, 06:03 PM
This works for me in Opera 7, and it should work in Opera 6 as well:



listItem {
display: list-item;
list-style: outside;
}

listItem:before {
display: marker;
content: counter(counter) ".)";
counter-increment: counter;
width: 2em;
vertical-align: middle;
}


I used this as my test document:



<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="list.css"?>

<docEl>
<masterList>
<listItem>Hello</listItem>
<listItem>World</listItem>
</masterList>
</docEl>


Mozilla supports content:, but it does not to my knowledge support counter(), though I do seem to remember seeing -moz-counter() before...

jeorg
11-28-2002, 06:48 PM
it works only for Opera

even in that way

<!doctype html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fen">
<head>
<style type="text/css" >
listItem {
display: list-item;
list-style: outside;
}

listItem:before {
display: marker;
content: counter(counter) ".)";
counter-increment: counter;
width: 2em;
vertical-align: middle;
}

</style>
</head>
<body>
<docEl>
<masterList>
<listItem>Hello</listItem>
<listItem>World</listItem>
</masterList>
</docEl>
</body>
</html>




thank you

jeorg
11-28-2002, 06:53 PM
this too

<!doctype html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fen">
<head>
<style type="text/css" >
tag {
display: list-item;
list-style: outside;
}

tag:before {
display: marker;
content: counter(counter) ".)";
counter-increment: counter;
width: 2em;
vertical-align: middle;
}

</style>
</head>
<body>
<div>
<div>
<tag>Hello</tag>
<tag>World</tag>
</div>
</div>
</body>
</html>

it works


...only opera :-((



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum