Solved

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

Posted on 2011-03-16
4
854 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
ID: 35152376
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
ID: 35152619
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
ID: 35152648
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
ID: 35152727
Yes Iam using CSS...
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
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…

773 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