I’m working on a really big project, but on a certain page, an image is displaying and going above what I set the max-width
property to (100%
).
Please help. WorldCache
would you mind telling me what image? What is the expected vs actual output?
I don’t see any css rules being applied which have anything to do with width. Are you sure you linked the right CSS stylesheet?
@python660 On the image’s container, cache-info
, the max-width
property is set. I cannot directly set styles for the image as it is data that is pulled from another site.
The image has to be a under a cover image rule.
Then you should be able to scale the image.
to make the process easier, would you mind telling me which file this property is being set?
Also, cache-info is the whole div, and since overlfow is set i think that might be a problem?
(Oops, wrong person!) lol
What do you mean?
Huh?
I agree, you have to find the image to set width, otherwise you are setting the width of the container while allowing the image to overflow (overflow css is set somewhere).
What would I change the overflow css to to fix this?
try it out. doesnt hurt
just comment out the overflow property and try it out if it doesnt work just uncomment it back. no harm done.
Try object-fit: cover;
.
It should work
sorry overflow css is my user agent stylesheet
Instead, set max-width: 90% on the image.
@python660 again, I have no access to the properties of the image. If there is a way to do something like div.cache-info:nth-child(1)
but for any img tags? Like select all the child images within a parent div?
yes. such as div.cache-info:nth-child(9) img
.