2
I have a Wordpress site. In the theme, I need to customize the height
of a single div
class image_wrapper
, but when I make the change, it reflects on the other divs
of the same class spread by the theme.
How can I define the height
in this case, without the other divs
undergo the change?
To div
that I need to customize is contained in this other:
<div class="image_frame scale-with-grid product-loop-thumb">
<div class="image_wrapper">
<a href=""></a>
</div>
</div>
div.image_wrapper {
height: 192px; }
When I use the CSS above, others divs
of the same class are amended as follows::
<div class="image_wrapper"><img class="scale-with-grid" src="" alt=""></div>
How can it be solved? I couldn’t use specificity in this case.
You can change that specific div?
– Sam
You will have to create a single selector for this element. If you have any parent element that defines a
id
will make it a lot easier. You can use the browser inspector to assist you in this process: press the right mouse button on the desired element and go to "Inspect Element", make sure the correct element is properly selected by the inspector and see the entire selector in the bar below. But if you edit HTML things get a lot easier.– Woss
Thank you very much!
– Fernando