Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-03-16
4
Medium Priority
?
862 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 2000 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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

688 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