I don't know if there is an issue, but I was wondering why the overflow:hidden
does not function on fixed
parent/children element.
Here's an example:
CSS and HTML:
.parent{ position:fixed; overflow:hidden; width:300px; height:300px; background:#555; } .children{ position:fixed; top:200px; left:200px; width:150px; height:150px; background:#333; }
<div class="parent"> <div class="children"> </div> </div>
Live demo: jsFiddle
What does PARENT mean? parent(noun) a father or mother; one who begets or one who gives birth to or nurtures and raises a child; a relative who plays the role of guardian.
Parents is the plural form of parent. Parents' is the possessive form referring to more than one parent. Parent's means belonging to one parent in writing English and parents' means belonging to more than one parent. Whenever we talk about plural possessions, apostrophe ( ' ) goes at the very end.
A parent is a mother or father. Your mom and your dad are your parents, and one of their jobs is to parent you. We're all born to parents, and many of us also have step parents, foster parents, or adoptive parents who parent us.
The father and mother whose DNA a child carries are usually called the child's biological parents. Legal parents have a family relationship to the child by law, but do not need to be related by blood, for example in the case of an adopted child.
You could consider using CSS clip: rect(top, right, bottom, left);
to clip a fixed positioned element to a parent. See demo at http://jsfiddle.net/lmeurs/jf3t0fmf/.
Beware, use with care!
Though the clip style is widely supported, main disadvantages are that:
auto
value equals 100%
, ie. clip: rect(auto, auto, auto, auto);
;See http://tympanus.net/codrops/2013/01/16/understanding-the-css-clip-property/ for more info.
EDIT: Chrome seems to handle positioning of and CSS3 transforms on child elements a lot better when applying backface-visibility, so just to be sure we added:
-webkit-backface-visibility: hidden; -moz-backface-visibility: hidden; backface-visibility: hidden;
to the main child element.
Also note that it's not fully supported by older / mobile browsers or it might take some extra effort. See our implementation for the menu at bellafuchsia.com.
EDIT 2014-11-02: Demo URL has been updated.
Because a fixed position element is fixed with respect to the viewport, not another element. Therefore since the viewport isn't cutting it off, the overflow becomes irrelevant.
Whereas the position and dimensions of an element with position:absolute are relative to its containing block, the position and dimensions of an element with position:fixed are always relative to the initial containing block. This is normally the viewport: the browser window or the paper’s page box.
ref: http://www.w3.org/wiki/CSS_absolute_and_fixed_positioning#Fixed_positioning
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With