HTML and CSS: What do the and - tags stand for?
Emily Wong
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?
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
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).
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".