Brian 10

This is generally for forms: I'd like to insert text within the a list without those nodes being, themselves, list items. It there anything in HTML which facilitates this, or is there another good technique?

Thank you, example below:



  • List item 1
  • List item 2


  • List item 3
  • List item 4


  • You want something in the list that is not inside the list tags? Is it required to not be in the list tags, or do you just want it to show without a bullet? Chris Sobolewski over 8 years ago

2 answers

orta 244

You can remove and change the bullets in lists using CSS, this article goes into depth about it:

Answered over 8 years ago by orta
  • Bit of a misunderstanding. I was wondering if there was a valid way to mark up those Descriptions without landing them in LIs. Thank you! Brian over 8 years ago
  • @brian but why would you want to do that? Probably then a list is not the right element. Divya Manian over 8 years ago
  • wouldn't it be better to have more than one list - i.e a description then a list, another description then another list etc. but if it's for forms, why not group with fieldsets and use the legend for the descriptive text? Tony Crockford over 8 years ago
George 68

I'm not totally sure if I understand what you are looking for, but it sounds like a definition list could be used.

It would be structured:

       <dd>List item 1</dd>
       <dd>List item 1</dd>

       <dd>List item 3</dd>
       <dd>List item 4</dd>

And use:

dd  {
background:transparent url(../img/bullet.gif) no-repeat scroll 0 5px;
padding:0 0 0 10px;

in your css to add bullets on the list items.

Answered over 8 years ago by George