Solved

html - 'li' controls cannot be nested within a <div> tag

Posted on 2011-03-16
4
852 Views
Last Modified: 2012-05-11
Okay im trying to make bullets..if I can use the <li></li> list tages,,,then what can I use..?
0
Comment
Question by:GlobaLevel
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
AriMc earned 500 total points
Comment Utility
What do you mean they can't be nested? Try this:

<div>
<ul>
   <li>a</li>
   <li>b</li>
   <li>c</li>
   <li style="{list-style:none}">
      <ul>
         <li>1</li>
         <li>2</li>
         <li>3</li>
      </ul>
   </li>
<ul>
</div>

Open in new window

0
 
LVL 14

Expert Comment

by:Designbyonyx
Comment Utility
The LI tag is a "list item".  The UL and OL tags are "unordered list" and "ordered list" respectively.  In HTML, a list is made up of list items.  The rule is this:

1) UL and OL can only have one type of child node: LI
2) The LI node can only exist immediately underneath an OL or UL node
3) You can put ANYTHING inside a LI node

This is valid:
<ul>
  <li><a href="#">Link 1</a></li>
  <li><a href="#">Link 2</a></li>
  <li>
    <a href="#">Link 3</a>
    <ol>
      <li><a href="#">Link 3-1</a></li>
      <li><span>Text inside a span</span></li>
    </ol>
  </li>
  <li>
    <div>Some text here</div>
  </li>
</ul>
0
 
LVL 14

Expert Comment

by:Designbyonyx
Comment Utility
Also, if you are using a CSS RESET stylesheet, then you will need to add this to your site stylesheet to get your bullets and formatting back.

ul {
  padding: 1em;
  list-style: disc outside none;
}
li {
  margin-left: 2em;
}
0
 
LVL 10

Author Comment

by:GlobaLevel
Comment Utility
Yes Iam using CSS...
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now