1 reply [Last post]
gautamz07
gautamz07's picture
Offline
Enthusiast
Last seen: 3 years 36 weeks ago
Timezone: GMT+5.5
Joined: 2014-04-24
Posts: 265
Points: 403

Given the following HTML

<ul class="ul-items"> 
              <li><a href="#">Essen, Germany</a></li>
              <li><a href="#">Technical Solutions Engineer</a></li>
</ul>

in the CSS stylesheet i have the folloing CSS :

ul .ul-items li , a {
    list-style-type: none;
}

What does the selector read as
a) select the li and a under the class .ul-items of element ul .
b) select the li under the class .ul-items of element ul , and than select the a tags in the entire document(i guess the 1st answer is correct but just conforming).

my 2nd and most important question :

now if i want to remove the default list styling of the li tag (namely the dot) both the below code snippets work ,

ul.ul-items {
	list-style-type: none;
}

ul.ul-items li {
	list-style-type: none;
}
 
Why do both work ??????? 

Thanks alot .

Gautam.

gautamz07
gautamz07's picture
Offline
Enthusiast
Last seen: 3 years 36 weeks ago
Timezone: GMT+5.5
Joined: 2014-04-24
Posts: 265
Points: 403

Ok so i was working with some random CSS and HTML and

this(look below)

.ul-work a{
	padding-left:2em;
 
}
 
.ul-work li{
	margin-top: .5em;
}

turns out to be completely diffferent from This

.ul-work a , li{
	padding-left:2em;
        margin-top: .5em;	
}

when i for soooo long have been thinking that both are the same ! OMG ! .