Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML and CSS: What do the <ul> and <li> tags stand for?

Tags:

html

css

In the following lines of CSS code:

.sf-menu li:hover ul, .sf-menu li.sfHover ul {top: 40px!important; }

What do the HTML tags <ul> and <li> mean?

like image 687
Arthur Mamou-Mani Avatar asked Jul 02 '12 22:07

Arthur Mamou-Mani


People also ask

What does UL and Li mean in HTML?

Unordered lists ( UL ), ordered lists ( OL ), and list items ( LI )

What is Li and UL in CSS?

The <li> tag defines a list item. The <li> tag is used inside ordered lists(<ol>), unordered lists (<ul>), and in menu lists (<menu>). In <ul> and <menu>, the list items will usually be displayed with bullet points. In <ol>, the list items will usually be displayed with numbers or letters. Tip: Use CSS to style lists.

What does UL tag mean in HTML?

The <ul> HTML element represents an unordered list of items, typically rendered as a bulleted list.

What is UL in CSS?

HTML Lists and CSS List Properties. In HTML, there are two main types of lists: unordered lists (<ul>) - the list items are marked with bullets. ordered lists (<ol>) - the list items are marked with numbers or letters.


3 Answers

It's from the HTML elements of the same name.

UL - Unordered List (an ordered, or numbered, list would be OL)
LI - List Item

like image 179
craig65535 Avatar answered Sep 17 '22 23:09

craig65535


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).

like image 28
tskuzzy Avatar answered Sep 19 '22 23:09

tskuzzy


They target <ul> and <li> elements in the page.

In CSS an id is prefixed by #, a class is prefixed by ., and an element has no prefix at all.

So the selector .sf-menu li:hover ul will apply to any <ul> element, inside an <li> element that you are currently pointing at, inside an element with class="sf-menu".

The selector .sf-menu li.sfHover ul will apply to any <ul> element, inside an <li> element with class="sfHover", inside an element with class="sf-menu".

like image 24
Guffa Avatar answered Sep 17 '22 23:09

Guffa