Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to group `<li>` elements?

Tags:

html

xhtml

I need to divide into groups several <li> elements in a list, is it possible? (I know I an give each element different class names/separate into different <ul>)

like image 840
Itay Moav -Malimovka Avatar asked Jun 02 '10 13:06

Itay Moav -Malimovka


People also ask

Can you put Li inside div?

No. This is invalid HTML. Permittend content: zero or more <li> elements, eventually mixed with <ol> and <ul> elements.

What is the best way to group from elements in HTML?

The <div> tag is used to group other HTML content together. The <div> element doesn't add or change the content of your HTML. Instead, its main purpose is to provide an easy way to target and each group.

Which tag is used for grouping the elements in?

The <fieldset> tag is used to group related elements in a form. The <fieldset> tag draws a box around the related elements.

What is the difference between UL and Li?

ul stands for unordered list. li stands for list item. They are the HTML tags for "bulleted" lists as opposed to "numbered" lists (which are specified by ol for ordered list).


1 Answers

Have you considered nested UL's? I believe this would validate:

<UL>     <LI>         <UL>             <LI></LI>             <LI></LI>             <LI></LI>         </UL>     </LI>     <LI>         <UL>             <LI></LI>             <LI></LI>             <LI></LI>             <LI></LI>             <LI></LI>         </UL>     </LI> </UL> 

Your CSS trick was my first guess; too bad you can't use that.

like image 111
LesterDove Avatar answered Sep 22 '22 16:09

LesterDove