Image Going Off Screen

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

1 Like

would you mind telling me what image? What is the expected vs actual output?

2 Likes

@python660 Here are some images to help describe the issue.

2 Likes

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?

1 Like

@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.

2 Likes

The image has to be a under a cover image rule.
Then you should be able to scale the image.

1 Like

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?

1 Like

(Oops, wrong person!) lol

1 Like

What do you mean?


Huh?

2 Likes

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).

1 Like

What would I change the overflow css to to fix this?

2 Likes

try it out. doesnt hurt :slightly_smiling_face:

1 Like

@python660 But what would I set it to?

2 Likes

just comment out the overflow property and try it out :slight_smile: if it doesnt work just uncomment it back. no harm done.

1 Like

Try object-fit: cover;.
It should work

1 Like

@Spcfork object-fit: cover; didn’t work :frowning:


@python660 I have not used overflow CSS in this program.

sorry overflow css is my user agent stylesheet :sweat_smile:

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.