Result
よく見るCSS吹き出しに画像背景を設定した案
通常の吹き出しを作る方法とは異なり、余白個所を疑似要素で作ってあります
css
.image {
width : 300px ;
position : relative ;
margin : 20px auto ;
}
.image img {
display : block ;
width : 100% ;
positon:rerative;
}
.image:before {
display : block ;
content : "" ;
border-bottom : 20px solid #fff ;
border-right : 20px solid transparent ;
position : absolute ;
bottom : 0 ;
left : 0 ;
width : 130px ;
}
.image:after {
display : block ;
content : "" ;
border-bottom : 20px solid #fff ;
border-left : 20px solid transparent ;
position : absolute ;
bottom : 0 ;
right : 0 ;
width : 130px ;
}
p{
position : absolute ;
color : #fff ;
padding : 20px ;
}
|
html
< div class = "image" >
< p >(・▽・)</ p >
< img src = "https://picsum.photos/400/300" draggable = "false" />
</ div >
|
via
Image arrow (Pure CSS)