I've got a <div>
, that's a certain height
and width
, and overflow:hidden
so that specfic inner images are clipped; however I want one image in the <div>
to pop out of the border (ie to override the overflow:hidden
), how do I do this?
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
- Adding a timeout to a render function in ReactJS
overflow refers to the container not allowing oversized content to be displayed (when set to hidden). It's got nothing to do with inner elements that can have overflow:whatever, and still wont' be displayed.
Wrap your
overflow: hidden
div
with anotherdiv
that has a css property of -transform: translate(0, 0);
and in your specefic tag that you want it to override the -
overflow: hidden
, set it with -position: fixed;
it will continue to be position relatively to its parenti.e -
See the fiddle here
I've got a super-easy solution to this problem: Use the "pre" tag. I know the pre tag is the equivalent of using "goto" in programming, but hey: it works!
You cannot, unless you change your HTML layout and move that image out of the parent div. A little more context would help you find an acceptable solution.
All given answers where not satisfying for me. They are all hackish in my opinion and difficult to implement in complex layouts.
So here is a simple solution:
Once a parent has a certain overflow, there is no way to let its children override this.
If a child needs to override the parent overflow, then a child can have a different overflow than the other children.
So define the overflow on each child instead of declaring it on the parent:
Here is a fiddle:
http://jsfiddle.net/ryojeg1b/1/