Forum Moderators: not2easy

Message Too Old, No Replies

Font weight stays high after </li>

Text doesn't seem to convert back to normal

         

Kenton

11:13 pm on Mar 17, 2004 (gmt 0)

10+ Year Member



Hi All - be kind to the CSS newbie ;-)

I'm stuck on a CSS <li> problem.

The font weight from <li> sticks on even after the </li>. The only way I can seem to turn it off is with a <p> at the start of the normal text or use <ul> (and I don't want to do either).

from my CSS file


li {
margin:0 0 0 15px;
text-indent:-15px;
font-weight: 600;
}

From my html

<div class="content">
<h2>Heading-1</h2>
Description-1<br>
<li>Price-1<br><br></li>

<h2>Heading-2</h2>
Description-2<br>
<li>Price-2</li>
</div>

It comes out like this:
Heading-1
Description-1
  • Price-1

    Heading-2
    Description-2

  • Price-2

    but I want "description-2" (and decription-3 et al) not to be bold.

    Doesn't seem to matter if I define the <li> in the body or in the .content class.

    What am I doing wrong?

    Thanks in advance
    Kenton

  • grahamstewart

    11:19 pm on Mar 17, 2004 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    Try ditching the <br>s

    py9jmas

    11:28 pm on Mar 17, 2004 (gmt 0)

    10+ Year Member



    To work as expected the CSS needs to be applied to valid HTML.

    List items <li> belong in either ordered lists <ol> or un-ordered lists <ul>.

    eg:

    <ul>
    <li>Item 1</li>
    <li>Item 2</li>
    </ul>

    See:
    [w3.org...]
    for the spec.

    Jon.

    Rambo Tribble

    11:30 pm on Mar 17, 2004 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    I don't believe it's legal to have anything but list items inside unordered list tags. You could make your headers a class of list item that gets the bold.

    Kenton

    11:35 pm on Mar 17, 2004 (gmt 0)

    10+ Year Member



    Thanks all

    Jon (py9jmas) - that worked great - Thanks

    Kneton