Can somebody please explain what the selectors mean?
As far as I understand having #myId – is css for control with id=myId.
.myClass is Css for controls with class myClass.
Can somebody please explain the other combinations?
div.img a:hover img
{
border:1px solid #0000ff;
}
div.desc
{
text-align:center;
font-weight:normal;
width:120px;
margin:2px;
}
An id (#) can exist only once in a document. It is really useful to identify an element in CSS ans in JavaScript as well (should you ever need it).`
A class (.) can be used as often as it is required.
Example: you have only one header:
<div id="header">Header</div>, but several articles:<div class="article">...</div>Say you have this HTML document:
The heading of the articles shouldn’t be as big as the heading of the site, so we have to use a more specific selector:
.article h1 {...}. This will style every<h1>element in a element of the class “article”.If we want to have an even more specific selector, we would use:
div.article h1 {...}. This will only style every<h1>element in a<div>box with the class “article”