- This topic is empty.
-
AuthorPosts
-
October 4, 2017 at 4:12 am #260899
vulkanus
ParticipantHi,
Can anyone help me with this issue.
I have a div class=”imgV” and a img inside with this class:.imgV { max-width: 540px; max-height: 263px; background: white; object-fit: cover; animation: ltr 3s alternate infinite; width: 100%; height: 100%;}
.imgV img { width: auto; overflow: hidden; overflow-y: hidden; position: absolute; display: inline-block; vertical-align: middle;}and other div class=”article-content-wrapper” … below with:
.article-content-wrapper { width: 100%; height: auto; border-top: 1px solid #ccc; padding-bottom: 15px; margin-top: 15px; margin-top: 72%;}and the images vertical is bigger then horizontal images more or less -159px. In full browser is OK, but when reduce, the image get out vertical, didn“t fit correctly.
How can I put parte of the image hidden?
Thank you in advance.October 4, 2017 at 4:57 am #260900Paulie_D
MemberIt’s hard to understand your issue from the little you have given us.
Could you make a demo in Codepen.io with just enough code to show the problem?
October 4, 2017 at 5:44 am #260901vulkanus
ParticipantHi, thk for your reaply. I will try it.
October 4, 2017 at 8:04 am #260907vulkanus
ParticipantPlease: https://codepen.io/anon/pen/NawaBO
This is what I can do without the rest of css code from full page.
The diferente is the first image is Vertical, and I use the max-height: 253px (but in codepen, I have comment) to you see what happens to the site posts.
Thank you
October 4, 2017 at 11:29 pm #260978JeroenR
ParticipantThe property overflow only works on an item with a height set. Your div with class ‘imgV’ has the property overflow set, but it doesn’t have a height. So that’s why it doesn’t work.
And overflow should be set on the container, not on the item itself, so you shouldn’t set it on the image itself.So make sure your containers have the same dimensions in all screens, then the images will have those dimensions as well.
October 16, 2017 at 2:46 pm #261419vulkanus
ParticipantHi @JeroenR,
Thank you.
I allready have resolved the issue with your tips, and understand what was wrong.best cumps.
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.