自定义代码
.author-profile .profile img {
width: 30px;
height: 30px;
}
.entry-content p a {
padding-bottom: 5px; /* 为下划线预留空间 */
color: #00bfff; /* 默认链接颜色为天蓝色 */
position: relative; /* 为伪元素创建定位基准 */
display: inline;
cursor: pointer; /* 鼠标悬停时显示帮助指针 */
}
.entry-content p a:hover {
text-decoration: none;
color: #007fff; /* 鼠标悬停时链接文字变为蓝色 */
}
.entry-content p a::after {
/* 这里插入你提供的CSS代码 */
content: "";
position: absolute;
width: 100%;
transform: scaleX(0);
height: 2px;
bottom: 0;
left: 0;
background-color: #007fff;
transform-origin: bottom right;
transition: transform 0.25s ease-out;
}
.entry-content p a:hover::after {
transform: scaleX(1); /* hover时展开 */
transform-origin: bottom left; /* 改变起点实现方向变化 */
}
/* 表格详细信息居中 */
.wp-block-details summary {
display: flex;
justify-content: center;
font-size: 20px
}
body .is-layout-flex {
justify-content: center;
}
.wp-container-core-group-is-layout-1 {
align-items: center !important;
}
/* 文章标题段落添加外左边距 */
.single-header .entry-census.has-splitter {
margin-left: 5px;
}
主题内部代码
文章标题下划线动画位置:inc\decorate.php
/*标题横线动画*/
@media (min-width: 860px) {
/* 1. 确保 h1 具备相对定位,作为线条的参考系 */
.single-center .single-header h1.entry-title {
position: relative;
/* 注意:这里不要再写 background-image 了 */
}
/* 2. 召唤一个真实的伪元素盒子来当线条 */
.single-center .single-header h1.entry-title::after {
content: '';
position: absolute;
bottom: -8px; /* 紧贴标题块的最底部 */
left: 0;
/* 决定线条的厚度和圆角 */
height: 10px; /* 你可以自由调整线条粗细 */
border-radius: 10px; /* 这里就是你心心念念的圆角! */
/* 核心魔法:继承原版的动态主题色,并实现 50% 半透明 */
background-color: color-mix(in srgb, var(--article-theme-highlight, var(--theme-skin-matching)) 50%, transparent);
/* 初始状态:宽度为0,准备执行动画 */
width: 0;
animation: lineWidth 2s ease forwards;
/* 放在文字底层避免遮挡文字 */
z-index: -1;
}
}
/* 3. 控制 ::after 盒子的宽度伸展 */
@keyframes lineWidth {
0% {
width: 0;
}
100% {
width: 100%; /* 如果不想占满全宽,可以改成你原版写的 20% 或 30% */
}
}
评论区标题下划线动画位置:style.css
h3#comments-list-title::after {
content: '';
position: absolute;
bottom: -15px;
left: 0%;
width: 100%;
height: 0.7em;
background-color: var(--article-theme-highlight,var(--theme-skin-matching)) !important;
opacity: 0.4;
z-index: 0;
border-radius: 30px;
transition: all 0.3s ease;
}
h3#comments-list-title:hover::after {
width: 85%;
opacity: 0.7;
}
二级标题下划线动画位置:css\content-style\sakura.css
.entry-content h2:after {
content: '';
position: absolute;
bottom: -20px !important;
left: 30%;
right: 0;
width: 70%;
height: 0.7em;
background-color: var(--article-theme-highlight,var(--theme-skin-matching));
opacity: 0.4;
z-index: 0;
border-radius: 30px;
transition: all 0.3s ease;
}
.entry-content h2:hover:after {
width: 85%;
left: 15%;
opacity: 0.7;
}

Comments NOTHING