**** HTML
**** HTML:
<div class="pdnews-pic">
<img src="anh.jpg">
</div>
**** CSS:
.pdnews-pic {
width: 100%;
height: 260px;
overflow: hidden;
position: relative;
}
.pdnews-pic::before {
content: "";
position: absolute;
top: 25px;
bottom: 25px;
left: 50%;
right: 50%;
border-top: solid 1px #ffffff;
border-bottom: solid 1px #ffffff;
-webkit-transition: all 0.3s linear;
-o-transition: all 0.3s linear;
transition: all 0.3s linear;
pointer-events: none;
z-index: 1;
}
.pdnews-pic::after {
content: "";
position: absolute;
left: 20px;
right: 20px;
top: 50%;
bottom: 50%;
border-left: solid 1px #ffffff;
border-right: solid 1px #ffffff;
-webkit-transition: all 0.3s linear;
-o-transition: all 0.3s linear;
transition: all 0.3s linear;
pointer-events: none;
z-index: 1;
}
.pdnews-pic:hover::before {
left: 15px;
right: 15px;
}
.pdnews-pic:hover::after {
top: 20px;
bottom: 20px;
}
.homecat-pic {
height: 150px;
width: 100%;
transition: all 0.3s ease-out;
--deg: 100deg;
}
.homecat-pic img {
width: 100%;
height: 100%;
object-fit: contain;
padding: 20px;
}
.homecat-pic:hover img {
animation: tada 2s infinite;
filter: brightness(1.05);
}
@keyframes tada {
0% {
transform: scaleX(1); }
10%,
20% {
transform: scale3d(0.9, 0.9, 0.9) rotate(-3deg); }
30%,
50%,
70%,
90% {
transform: scale3d(1.1, 1.1, 1.1) rotate(3deg); }
40%,
60%,
80% {
transform: scale3d(1.1, 1.1, 1.1) rotate(-3deg); }
to {
transform: scaleX(1); } }
**** CSS:
.inside-news-pic {
overflow: hidden;
position: relative;
height: 250px;
border: 1px solid #ccc;
width: 100%;
}
.inside-news-pic a img {
transition: all 0.3s ease-out;
height: 100%;
width: 100%;
object-fit: cover;
}
.inside-news-pic a:hover img {
transform: scale(1.2);
}