Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I style an image in css without having to give the image a class?

I’m working right now on a CMS called TYPO3 v.10 , this CMS is pretty complicated to me.

I have an image and a css-file, I can’t give the image a class or an id, I can give the image basically nothing, it’s just there and i have to style it.

So my question here is:
How can I style the image without giving it a class or an Id or anything else?(maybe using the source or something like that?)

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I’ve used the img tag in css, but I’ve changed every single image in the whole CMS.

/* not desired as it effects all images */
img {
  width: 100;
  height: 100;
}
<div>my missing HTML here</div>

>Solution :

Can you perhaps find a specific container(s)? If so, you can add a style to that. E.g.

section header .containername img {
}

If not, perhaps you can try other selectors. There are so many e.g. https://www.w3schools.com/cssref/css_selectors.php

If that doesn’t work, perhaps you can use javascript to add a class to the specific image, it’s container or anything near it.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading