Solved

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

Posted on 2011-03-16
4
861 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

636 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