WordPress教程:为任意主题模板添加角标,本站是以YIA主题修改的CSS样式
/* 角标代码ds17.cn*/
.yia-rds4 {
position: relative;
display: inline-block; /* 使伪元素相对于图片定位 */
}
.yia-rds4::after {
content: "示例文字"; /* 角标文字内容 */
position: absolute;
top: 5px; /* 距离图片顶部的距离,根据需要调整 */
right: 5px; /* 距离图片右侧的距离,根据需要调整 */
background-color: black; /* 背景颜色为黑色 */
color: white; /* 文字颜色为白色 */
padding: 2px 5px; /* 内边距,用于调整角标的尺寸 */
font-size: 12px; /* 字体大小,根据需要调整 */
border-radius: 3px; /* 边框圆角,可选 */
opacity: 0.8; /* 透明度,可选 */
}
.yia-rds4可以根据需要,改成自己主题的就行了