By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,487 Members | 1,074 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,487 IT Pros & Developers. It's quick & easy.

How to make sub-items of a list item?

P: n/a
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)
Jul 20 '05 #1
Share this Question
Share on Google+
13 Replies


P: n/a
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

--
Brian
follow the directions in my address to email me

Jul 20 '05 #2

P: n/a
In article geotso wrote:
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.)
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.

Jul 20 '05 #3

P: n/a
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:
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

Jul 20 '05 #4

P: n/a
Lauri Raittila wrote:
Since we are in stylesheet group, I assume you already know how to
markup nested ordered list,
you've guessed right!
Your example is inconsistant, I suppose "." in 3c is mistake?
Not exactly! I used that ". . . . . " part, just as a text replacement and
nothing more :)
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.
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!
Jul 20 '05 #5

P: n/a
geotso wrote on 30 okt 2003 in
comp.infosystems.www.authoring.stylesheets:
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)
Jul 20 '05 #6

P: n/a
Lauri Raittila <la***@raittila.cjb.net> wrote:
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/
Jul 20 '05 #7

P: n/a
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?
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)

Jul 20 '05 #8

P: n/a
Johannes Koch wrote on 31 okt 2003 in
comp.infosystems.www.authoring.stylesheets:
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)
Jul 20 '05 #9

P: n/a
Evertjan. wrote:
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.
What part is invalid, the qwerty?
You know how to validate HTML? Hint: <http://validator.w3.org/>
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.)

Jul 20 '05 #10

P: n/a
Johannes Koch wrote on 31 okt 2003 in
comp.infosystems.www.authoring.stylesheets:
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.
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)
Jul 20 '05 #11

P: n/a
"Evertjan." <ex**************@interxnl.net> wrote in
news:Xn********************@194.109.133.29:
Johannes Koch wrote on 31 okt 2003 in
comp.infosystems.www.authoring.stylesheets:
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.


When talking about HTML, "valid" and "invalid" are technical terms with
precise meanings. They're not subject to personal definitions. A valid
HTML document is one whose syntax conforms to the document type definition
(DTD) associated with its document type. An invalid HTML document is one
whose syntax doesn't conform. The question of whether or not the syntax
conforms is one that can be answered algorithmically, i.e. by a purely
mechanical process. Calling an HTML document "valid" or "invalid" is a
statement of fact, not a value judgment. People can hold differing
opinions on whether or not it's important for a document to be valid, but
not on whether or not a document *is* valid.
Jul 20 '05 #12

P: n/a
Evertjan. wrote:
You know how to validate HTML? Hint: <http://validator.w3.org/>


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


May I ask why you put "invalid"[1] in quotes?

[1]Yes, I realize the irony, but in my case I'm quoting. :)

--
Brian
follow the directions in my address to email me

Jul 20 '05 #13

P: n/a
Brian wrote on 31 okt 2003 in comp.infosystems.www.authoring.stylesheets:
Evertjan. wrote:
You know how to validate HTML? Hint: <http://validator.w3.org/>
Yes, if that is your definition of "invalid" then you are right.


May I ask why you put "invalid"[1] in quotes?


Yes, you may.
[1]Yes, I realize the irony, but in my case I'm quoting. :)


Same here.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #14

This discussion thread is closed

Replies have been disabled for this discussion.