HighDots Forums  

How to make sub-items of a list item?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss How to make sub-items of a list item? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
geotso
 
Posts: n/a

Default How to make sub-items of a list item? - 10-30-2003 , 01:39 PM






What I'm trying to do is something like this:
1. . . . .
2. . . . .
3a . . . .
3b . . . .
3c. . . . .
4. . . . .
etc.

Can you help me please?

--
____________________________
geotso's stories
Be thou attentive!...

(Please, remove the TRAP to contact me)



Reply With Quote
  #2  
Old   
Lauri Raittila
 
Posts: n/a

Default Re: How to make sub-items of a list item? - 10-30-2003 , 02:25 PM






In article geotso wrote:
Quote:
What I'm trying to do is something like this:
Since we are in stylesheet group, I assume you already know how to markup
nested ordered list, and aim for exact look. (and if not, look source of
example.)

Quote:
1. . . . .
2. . . . .
3a . . . .
3b . . . .
3c. . . . .
4. . . . .
etc.
Your example is inconsistant, I suppose "." in 3c is mistake? You need to
use counters. Works only on Opera 5+, but is possible to make it degrade
somewhat OK, I think.

Example:
http://www.iki.fi/lr/www/css/example...numbering.html
(tested on Opera 7.21)

References:
http://www.w3.org/TR/CSS21/generate.html
http://www.w3.org/TR/CSS21/syndata.html#counter

It might be better hardcode numbering. If it is really meaningful.


--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.



Reply With Quote
  #3  
Old   
geotso
 
Posts: n/a

Default Re: How to make sub-items of a list item? - 10-30-2003 , 02:36 PM



Brian,

Thanks for your try, but I think it's not what I was asking for, and that's
my fault:
A common ordered list like the one you've posted, produces this result:

1
2
3
1
2
3
4
where the sub-items are indented under the item they belong.
I want the sub-items in the same vertical-alinment and numbered with the
same number, followed by a sub-count, like the one in my first post:
1
2
3a
3b
3c
4
etc.

Maybe you mean something by that "with styles to suggest numbering" that I
don't get it. Could you explain it a bit please?

Thanks again.

Brian wrote:
Quote:
geotso wrote:
What I'm trying to do is something like this:
1. . . . .
2. . . . .
3a . . . .
3b . . . .
3c. . . . .
4. . . . .
etc.

ol
li
li
li
ol
li
li
li
/ol
li
!-- etc. --
/ol

with styles to suggest numbering. That might be a good starting
point. I don't know what the context is, so I can't offer more
specifics.

Can you help me please?

Well, start with the spec, and you can help yourself.
http://www.w3.org/TR/html401/struct/lists.html



Reply With Quote
  #4  
Old   
geotso
 
Posts: n/a

Default Re: How to make sub-items of a list item? - 10-30-2003 , 03:03 PM



Lauri Raittila wrote:

Quote:
Since we are in stylesheet group, I assume you already know how to
markup nested ordered list,
you've guessed right!

Quote:
Your example is inconsistant, I suppose "." in 3c is mistake?
Not exactly! I used that ". . . . . " part, just as a text replacement and
nothing more

Quote:
You need to use counters. Works only on Opera 5+, but is possible to
make it degrade somewhat OK, I think.
hmm. I don't like it, because I want it for a IE specific project.

Quote:
It might be better hardcode numbering. If it is really meaningful.
I think you've right again! I was looking for the easy way, but it doesn't
matter!
Thanks for your try!




Reply With Quote
  #5  
Old   
Evertjan.
 
Posts: n/a

Default Re: How to make sub-items of a list item? - 10-30-2003 , 03:47 PM



geotso wrote on 30 okt 2003 in
comp.infosystems.www.authoring.stylesheets:

Quote:
I think you've right again! I was looking for the easy way, but it
doesn't matter!
Experimenting, I diverted from the topic and made this:

<script>var x=7</script>

<ol type="a">
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
<script>document.write("<li value="+ x-- +">")</script>qwerty
</ol>


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


Reply With Quote
  #6  
Old   
Jukka K. Korpela
 
Posts: n/a

Default Re: How to make sub-items of a list item? - 10-30-2003 , 04:05 PM



Lauri Raittila <lauri (AT) raittila (DOT) cjb.net> wrote:

Quote:
It might be better hardcode numbering. If it is really meaningful.
Yes, I'm afraid we need to wait for a few years before generated content and
automatic numbering are well enough supported.

Just to spell things out, hardcode numbering would best use simple
<ul> lists, nested when needed, and containing the numbers in the <li>
element contents. And CSS would be used just to suppress the default
bullets.

It's somewhat illogical to use <ul> when it's actually numbered, but the
risk of getting bullets is more tolerable than the risk of getting extra
numbers in front of the hardcode numbers (when CSS is disabled, or our
list-style-type is overridden by a user style sheet).

--
Yucca, http://www.cs.tut.fi/~jkorpela/


Reply With Quote
  #7  
Old   
Johannes Koch
 
Posts: n/a

Default Re: How to make sub-items of a list item? - 10-31-2003 , 03:23 AM



Evertjan. wrote:
Quote:
script>var x=7</script

ol type="a"
script>document.write("<li value="+ x-- +">")</script>qwerty
script>document.write("<li value="+ x-- +">")</script>qwerty
script>document.write("<li value="+ x-- +">")</script>qwerty
script>document.write("<li value="+ x-- +">")</script>qwerty
script>document.write("<li value="+ x-- +">")</script>qwerty
script>document.write("<li value="+ x-- +">")</script>qwerty
script>document.write("<li value="+ x-- +">")</script>qwerty
/ol
You know that this is invalid?
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)



Reply With Quote
  #8  
Old   
Evertjan.
 
Posts: n/a

Default Re: How to make sub-items of a list item? - 10-31-2003 , 03:54 AM



Johannes Koch wrote on 31 okt 2003 in
comp.infosystems.www.authoring.stylesheets:

Quote:
Evertjan. wrote:
script>var x=7</script

ol type="a"
script>document.write("<li value="+ x-- +">")</script>qwerty
script>document.write("<li value="+ x-- +">")</script>qwerty
script>document.write("<li value="+ x-- +">")</script>qwerty
script>document.write("<li value="+ x-- +">")</script>qwerty
script>document.write("<li value="+ x-- +">")</script>qwerty
script>document.write("<li value="+ x-- +">")</script>qwerty
script>document.write("<li value="+ x-- +">")</script>qwerty
/ol

You know that this is invalid?
No

Depreciated yes.

Invalid, why?
What part is invalid, the qwerty?
Tested under IE6

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


Reply With Quote
  #9  
Old   
Johannes Koch
 
Posts: n/a

Default Re: How to make sub-items of a list item? - 10-31-2003 , 04:04 AM



Evertjan. wrote:
Quote:
Johannes Koch wrote on 31 okt 2003 in
comp.infosystems.www.authoring.stylesheets:


Evertjan. wrote:
[invalid HTML code]
You know that this is invalid?


No

Depreciated yes.

Invalid, why?
E.g. ol elements cannot contains script elements.

Quote:
What part is invalid, the qwerty?
You know how to validate HTML? Hint: <http://validator.w3.org/>

Quote:
Tested under IE6
You know that testing in WinIE with its Mega Bytes of error recovery
routines is not a good method to test for correctness of code?
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)



Reply With Quote
  #10  
Old   
Evertjan.
 
Posts: n/a

Default Re: How to make sub-items of a list item? - 10-31-2003 , 04:51 AM



Johannes Koch wrote on 31 okt 2003 in
comp.infosystems.www.authoring.stylesheets:
Quote:
E.g. ol elements cannot contains script elements.

What part is invalid, the qwerty?

You know how to validate HTML? Hint: <http://validator.w3.org/

Yes, if that is your definition of "invalid" then you are right.

Quote:
E.g. ol elements cannot contains script elements.
Perhaps according to the spec., but a document.write should not harm, IMHO.
I could include the <ol> in the document.write.

My only point was that it is possible to have a decrementing <ol> sequence.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.