I need to make an image invisible outside parent div (image are bigger than parent div), without changing
position: fixed
. Why overflow: hidden
not working?Thank for any advice!
moodware moodware
5 Answers
You cant use Overflow hidden with fixed elements.
Save to Google Drive. If you have a Google account, you can save this code to your Google Drive. Google will ask you to confirm Google Drive access. In the first case where I don’t want the image to stick out of the div and be visible The overflow: hidden doesn’t work for safari. Do you know a work around it? I read that safari has a bug with position and overflow. I took out position complete still it gives me the same issue can you please suggest any work around that you may have for.
For an element with
fixed positioning
, viewport becomes the relative element and not the parent element. That's why parent's overflow hidden
property becomes irrelevant.I would suggest that you use
position absolute
and relative
properties to achieve your result and then may be add another wrapper on top of it to fixed position
the entire thing.I hope the result below is what you were expecting.
Kiran DashKiran Dash
overflow:hidden
working when you remove property position:fixed
in image tag ankita patelankita patel
You have not define div height or width with any
unit(px or %)
that's why ur code is not working properly nittsnitts
Remove
position: fixed
from class ='image'
, because When you use position:fixed
, an item to be removed from the flow. when your div have fixed position his childs already are fixed to the window, but when you use fixed position to childs, you remove it from this parent.AlexAlex
devadineshdevadinesh