CSS乾貨
摺疊打開時內容物的飄移動畫
details[open] summary ~ * {
animation: sweep .5s ease-in-out;
}
@keyframes sweep {
0% {opacity: 0; transform: translateX(-10px)}
100% {opacity: 1; transform: translateX(0)}
}
漸層字
background: -webkit-linear-gradient(180deg, rgba(238,174,202,1) 0%, rgba(148,187,233,1) 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
圖片顯示改回默認值
img {
display: initial;
}
根據媒體尺寸改變CSS
@media screen and (max-width: 360px) {
/*要套用的內容*/
}