If I have something like this in my HTML
Welcome on my web
-
You can use
span.welcome
#top .welcome
#top div.txt span.welcome
.welcome
讨论(0)
-
If you want to use that 'welcome' class for perticular span tag than you can use two ways like...
.txt span.welcome
or
span.welcome
it will works for your CSS class in your code perfectly.
this is the concept of nesting class you can directly refer from internet sources too.
讨论(0)
-
.welcome
#top div.txt .welcome
div#top div.txt span.welcome
it depends on how specific you want to be
讨论(0)
-
div#top div.txt span.welcome
or
#top div.txt .welcome
or some other variation thereof...
讨论(0)
-
#top .txt .welcome{}
讨论(0)
-
#top .txt
is not #top.txt
the latter means that the matched element has the id AND the class, while the former means that the matched element has the class, and one of its ancestors element has the id
讨论(0)