AndreaNobili AndreaNobili - 2 months ago 8
CSS Question

How to correctly apply a CSS style to all the images in a div having a specific class?

I have the following HTML:

<div class="group-item">
<a href="profile.html">
<img src="resources/img/icons/projects/wifi.png">
</a>
</div>


I am trying to set the CSS property of the
img
tag inside the div having
class="group-item"
in this way:

.groups-item img {
float: left;
margin-right: 15px;
width: 80px;
}


but it does not work and it is not applied to the previous
img
tag (I used FireBug and I can see that the style is not applied)

Why? What am I missing? How can I correctly apply the style to all the img tags inside the div having
class="group-item"
?

Answer
.group-item img {
    float: left;
    margin-right: 15px;
    width: 80px;
}

should work, I removed the s from groups- in the css declaration