Jump to content

List heading


kurt.santo

Recommended Posts

It's valid to put <h> tags inside <li> tags.But if you want all the first <li> tags of each list to have a different style you can try the CSS pseudo-class:li:first-child {font-weight: bold;}This style will be applied to every <li> that's a first element of a list.

Link to comment
Share on other sites

It's valid to put <h> tags inside <li> tags.But if you want all the first <li> tags of each list to have a different style you can try the CSS pseudo-class:li:first-child {font-weight: bold;}This style will be applied to every <li> that's a first element of a list.
Thank you for your input! Have a go with given code...Kurt
Link to comment
Share on other sites

My personal preference is not to have a bullet point next to the heading because it isn't a member of the list, so I would modify the style to be:li:first-child {font-weight: bold;list-style: none;}However I usually use a definition list instead:

<dl>  <dt>Heading</dt>  <dd>Item 1</dd>  <dd>Item 2</dd></dl>

and style the dt element:dt {font-weight: bold;}Kevin

Link to comment
Share on other sites

My personal preference is not to have a bullet point next to the heading because it isn't a member of the list, so I would modify the style to be:li:first-child {font-weight: bold;list-style: none;}However I usually use a definition list instead:
<dl>  <dt>Heading</dt>  <dd>Item 1</dd>  <dd>Item 2</dd></dl>

and style the dt element:dt {font-weight: bold;}Kevin

Cheers Kevin, Never really thought about using a definition list. Sounds like a great idea!Kurt
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...