Reputation: 29519
.features img{...}
I understand .features
is custom CSS class and div is HTML element. But I don't understand what kind of relationship this syntax will build between them?
Upvotes: 1
Views: 93
Reputation: 245489
This syntax doesn't build any relationship between the .features
class and a div.
The style that you provided is styling any child <img>
tag contained within a .features
class.
Both of these would be valid and apply the given style to the image:
<div class="features">
<img src="myImg.png" />
</div>
and
<table class="features">
<tr>
<td><img src="myImg.png" /></td>
</tr>
</table>
If you wanted to specify that your class was only applicable to divs, you would need to change the declaration to:
div.features img { }
Upvotes: 3