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:

[ul]

Description

  • List item 1
  • List item 2

Description

  • List item 3
  • List item 4

[/ul]

  • 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 about 7 years ago

2 answers

orta 244
1
point

You can remove and change the bullets in lists using CSS, this article goes into depth about it: http://www.alistapart.com/articles/taminglists/

Answered about 7 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 about 7 years ago
  • @brian but why would you want to do that? Probably then a list is not the right element. Divya Manian about 7 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 about 7 years ago
George 68
0
points

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:

    <dl>
       <dt>Description</dt>
       <dd>List item 1</dd>
       <dd>List item 1</dd>

       <dt>Description</dt>
       <dd>List item 3</dd>
       <dd>List item 4</dd>
   </dl>

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 about 7 years ago by George