Click to See Complete Forum and Search --> : Overiding inheritance for font size for lists?
bobafifi
12-27-2007, 08:59 AM
Anybody know how to overide inheritance of font size for lists when the font size is set like so (they're showing up very small)?
body {
font-size: 62.5%;
font-family: Arial, Verdana, Geneva, Lucida, Helvetica, sans-serif;
}
Thanks!
-Bob
TJ111
12-27-2007, 09:34 AM
li {
font-size: 1.5em;
}
Are you sure you are providing the correct code? When I test it, all the lists come out the same (as well as the paragraphs). There are no inheritance problems that I can detect.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body style="font-size: 62.5%;">
<p>text text text</p>
<ul>
<li>item 1</li>
<ul><li>item 1a
<ul><li>item 1aa</li></ul>
</li></ul>
</ul>
</body>
</html>
Major Payne
12-27-2007, 11:23 PM
Ms. KDLA: You left out the li { font-size: 1.5em; }. With the code you provided and the li styling, each will have a separate size. You could even varied it like li, li, { font-size: 1.5em; } or li li li { font-size: 1.5em; } or any variation you can think of and watch each item text take on some text size. Also, one closing </li> tag needs to be moved.
This seemed to worked ok:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body {
font-size: 62.5%;
font-family: Arial, Verdana, Geneva, Lucida, Helvetica, sans-serif;
}
ul#list_item {
font-size: 1.5em;
}
</style>
</head>
<body>
<p>text text text</p>
<ul id="list_item">
<li>item 1
<ul><li>item 1a
<ul><li>item 1aa</li></ul>
</li></ul>
</li>
</ul>
</body>
</html>
Ron
I meant just using the original OP's code. It was a little vague in that he/she didn't state they were using a defined size beyond the "default" set in the body.