Instead of nested elements, you can simply use a pseudo-element. This is located at the bottom of the div container. To do this you need to position:relative
, and overflow:hidden
in the container div. In addition, pseudo-elements always need to be declared content
.
, left | width | height
. .
"" rgba(r,g,b,a)
, a
- .
passepartout border
.
#image2{
position:relative;
border:10px solid #888;
overflow:hidden;
box-shadow:0 0 4px #aaa;
}
#image2::after {
content:"";
display:block;
position: absolute;
bottom: 0;left:-10%;
background-color: #dc022e;
width: 120%;
height: 60%;
border-radius: 100% 100% 0 0;
opacity: 0.8;
}
#image2 img {
width: 100%;
display:block;
position:relative;
}
<div id="image2">
<img src="http://t1.gstatic.com/images?q=tbn:ANd9GcThtVuIQ7CBYssbdwtzZjVLI_uw09SeLmyrxaRQEngnQAked5ZB">
</div>
Hide result