9

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?

1
  • 8
    You'll need to learn HTML before CSS can be of any use. I'd suggest reading the HTML spec.
    – zzzzBov
    Jul 2, 2012 at 22:12

3 Answers 3

30

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

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

11

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

6

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.