How to correctly apply a CSS style to all the images in a div having a specific class?
13,276
.group-item img {
float: left;
margin-right: 15px;
width: 80px;
}
should work, I removed the s from groups-
in the css declaration
Author by
AndreaNobili
Updated on June 04, 2022Comments
-
AndreaNobili about 2 years
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 havingclass="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"
? -
mplungjan almost 9 yearsSeriously not worth an answer
-
mplungjan almost 9 yearsBecause I edited it before I tested to see what was wrong. Then I commented that it was a spelling mistake instead of answering it was a spelling mistake
-
Toni Leigh almost 9 years@mplungjan - fair enough, still, you have 50k points, I have 1.5k, I'm just trying to pull myself up a bit being new to the site, so I'll take some low hanging fruit here and there