Scalable fonts in nested lists...

C

Curtis

How does one use scalable fonts with nested lists?

Apparently if ul is {font-zize: 130%;} for example,

* A This is 130% of context
* A This is 130% of context
** B This is 130% of A
** B This is 130% of A
*** This is 130% of B
*** This is 130% of B

The HTML our program presently outputs is

<ul class="ulist" style="font-size: 130%;">
<li> A Item</li>
<li> A item</li>
<ul class="ulist" style="font-size: 130%;">
<li> B item</li>
<li> B item</li>
<ul class="ulist" style="font-size: 130%;">
<li> C item</li>
<li> C item</li>
</ul>
</ul>
<li> A item</li>
</ul>

Dropping the inline style and setting ul or ulist at
font-size: 130%; has the same effect. Each level of subitem
gets progressively larger.

Is there any way around this short of fized font sizes for
lists?

It would be easy enough for our code to generate different
class names for each level of list,
class="ulist1", ulist2, etc., but...

--

Curtis

Visit We the Thinking
www.wethethinking.com
An online magazine/forum
devoted to philosophical
thought.
 
C

Curtis

Curtis said:
How does one use scalable fonts with nested lists?

Apparently if ul is {font-zize: 130%;} for example,

* A This is 130% of context
* A This is 130% of context
** B This is 130% of A
** B This is 130% of A
*** This is 130% of B
*** This is 130% of B

The HTML our program presently outputs is

<ul class="ulist" style="font-size: 130%;">
<li> A Item</li>
<li> A item</li>
<ul class="ulist" style="font-size: 130%;">
<li> B item</li>
<li> B item</li>
<ul class="ulist" style="font-size: 130%;">
<li> C item</li>
<li> C item</li>
</ul>
</ul>
<li> A item</li>
</ul>

Dropping the inline style and setting ul or ulist at
font-size: 130%; has the same effect. Each level of subitem
gets progressively larger.

Is there any way around this short of fized font sizes for
lists?

It would be easy enough for our code to generate different
class names for each level of list,
class="ulist1", ulist2, etc., but...

I see that on Firefox "fixed" font sizes still respond to
scaling.

--

Curtis

Visit We the Thinking
www.wethethinking.com
An online magazine/forum
devoted to philosophical
thought.
 
D

David Dorward

Curtis said:
How does one use scalable fonts with nested lists?

Apparently if ul is {font-zize: 130%;} for example,

* A This is 130% of context
* A This is 130% of context
** B This is 130% of A
** B This is 130% of A
*** This is 130% of B
*** This is 130% of B

Yes, this is normal. If you want the top level list to be 130% of its
parent, but all its sublists to use the same font size then ...

ul { font-size: 130%; }
ul ul { font-size: 100%; }
 
T

Toby Inkster

Curtis said:
<ul class="ulist" style="font-size: 130%;">
<li> A Item</li>
<li> A item</li>
<ul class="ulist" style="font-size: 130%;">
<li> B item</li>
<li> B item</li>
<ul class="ulist" style="font-size: 130%;">
<li> C item</li>
<li> C item</li>
</ul>
</ul>
<li> A item</li>
</ul>

Your HTML is b0rken. ULs can't sit directly inside other ULs.

<ul class="ulist" style="font-size: 130%;">
<li>A Item</li>
<li>
A item
<ul class="ulist" style="font-size: 130%;">
<li>B item</li>
<li>
B item
<ul class="ulist" style="font-size: 130%;">
<li>C item</li>
<li>C item</li>
</ul>
</li>
</ul>
</li>
<li>A item</li>
</ul>
 
C

Curtis

David Dorward said:
Yes, this is normal. If you want the top level list to be 130% of its
parent, but all its sublists to use the same font size then ...

ul { font-size: 130%; }
ul ul { font-size: 100%; }

Excellent, David. That works at all levels, for every ul
that has a ul as a parent.

Thanks.

--

Curtis

Visit We the Thinking
www.wethethinking.com
An online magazine/forum
devoted to philosophical
thought.
 
N

Nick Theodorakis

message
[...]
Your HTML is b0rken. ULs can't sit directly inside other
ULs.

How do you suggest we make sublists?

Put the sublist before the closing </li>, thusly:

<ul>
<li>item 1</li>
<li>item 2
<ul>
<li>item 2a</li>
<li>item 2b</li>
</ul>
</li>
<li>item 3</li>
</ul>

Nick
 
M

Mark Parnell

Deciding to do something for the good of humanity, Curtis
How do you suggest we make sublists?

Exactly as in the code Toby posted, that you snipped when replying to
him.
W3.org is a little vague, at least what I read,

The DTD is quite clear - <ul> and <ol> can contain one or more <li>
elements - nothing else. Nested lists aren't specifically explained in
the prose, though there is an example.
but this
site specifically recommends it:

Then stop using that site as a reference.

They don't recommend that usage at all - they omit the closing tags for
the <li>. Though I wouldn't recommend using that site as a reference
anyway.
 
C

Curtis

message
et.au...
Deciding to do something for the good of humanity, Curtis


Exactly as in the code Toby posted, that you snipped when replying to
him.

I see that now. I read it hastily as a repeat of my own
code, the visual difference being subtle even if
significant.

The DTD is quite clear - <ul> and <ol> can contain one or
more said:
elements - nothing else.

I noticed that part, which is why their embedded OL didn't
make sense.
Nested lists aren't specifically explained in the prose,
though there is an example.

I did see the ordered list embedded in the ul, and if
embedded IN a <li>...</li> and not between
Then stop using that site as a reference.


They don't recommend that usage at all - they omit the closing tags for
the <li>. Though I wouldn't recommend using that site as a reference
anyway.

I see.

I now understand that one apparently embeds a list IN a list
item, and not between them. (The code embedding lists
between links puts our HTML that displays OK in Firefox, but
we'll rewrite the list functions to get that right.

Thanks.

--

Curtis

Visit We the Thinking
www.wethethinking.com
An online magazine/forum
devoted to philosophical
thought.
 
C

Curtis

Nick Theodorakis said:
message
[...]
Your HTML is b0rken. ULs can't sit directly inside
other
ULs.

How do you suggest we make sublists?

Put the sublist before the closing </li>, thusly:

<ul>
<li>item 1</li>
<li>item 2
<ul>
<li>item 2a</li>
<li>item 2b</li>
</ul>
</li>
<li>item 3</li>
</ul>

Thanks, Nick, for the very clear explanation. My eyes are
growing weary, as I failed to notice Tony's point.

--

Curtis

Visit We the Thinking
www.wethethinking.com
An online magazine/forum
devoted to philosophical
thought.
 
N

Neredbojias

With neither quill nor qualm, Curtis quothed:
Nick Theodorakis said:
message
[...]


Your HTML is b0rken. ULs can't sit directly inside other
ULs.

How do you suggest we make sublists?

Put the sublist before the closing </li>, thusly:

<ul>
<li>item 1</li>
<li>item 2
<ul>
<li>item 2a</li>
<li>item 2b</li>
</ul>
</li>
<li>item 3</li>
</ul>

Thanks, Nick, for the very clear explanation. My eyes are
growing weary, as I failed to notice Tony's point.

It's been noted before that "Tony's" point can be easily missed.
 

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,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top