오른쪽 하단 모서리에 태그를 추가해야하는 이미지가 있습니다.이미지 위에 절대 위치가있는 텍스트
내가 거기에 퍼팅 할 때, 이미지 아래 4px이고 패딩이나 여백이 없습니다.
.postImage {
position: relative;
display: inline-block;
}
.post img.thumbnail {
width:100%;
height: 100%;
}
.commercial {
position: absolute;
bottom: 0;
right: 0;
background-color: #666;
color: #fff;
padding: 3px;
font-size: 14px;
font-weight: 100;
}
<div class="postImage">
<img class="thumbnail" src="https://dummyimage.com/600x400/f00/fff">
<span class="commercial">commercial</span>
</div>
를 해결하는 가장 좋은 방법은 무엇입니까 ? 나는 생각하지 않는다
bottom: 4px;
이 맞다.
는 인라인 요소이기 때문에 바닥에 약간의 여분의 공간을 기본 이미지 태그함으로써
가 바로 이러한 목적으로 사용되므로 또한 캡션에 대한 래퍼와''에 대한''