菜单增加角标_wordpress主题美化[wordpress美化教程]
给你的wordpress菜单增添一些角标,给你的菜单添加一抹亮色。
<small>更新</small>
然后在前台通过CSS查到我们的small
,用CSS对其定位,在你的style.css
底部添加以下代码:
红色
.primary-menu small {
display: inline-block;
transform: translateY(-12px);
font-size: .75rem;
letter-spacing: 0.05em;
background: linear-gradient(to top, #f308a0 0%, #fb0655 100%);
color: #ffffff;
border-radius: 1rem;
padding: .15rem .275rem;
line-height: 1;
font-weight: bold;
}
保存后刷新浏览器本地缓存(或开隐私模式),查看前端页面即可看到效果。
黄色
.primary-menu small {
display: inline-block;
transform: translateY(-12px);
font-size: .75rem;
letter-spacing: 0.05em;
background: linear-gradient(to top, #efd3b0 0%, #f9e1be 100%);
color: #ffffff;
border-radius: 1rem;
padding: .15rem .275rem;
line-height: 1;
font-weight: bold;
}
蓝色
.primary-menu small {
display: inline-block;
-webkit-transform: translateY(-12px);
-ms-transform: translateY(-12px);
transform: translateY(-12px);
font-size: .75rem;
letter-spacing: 0.05em;
background: #188ef4;
background: -webkit-linear-gradient(legacy-direction(to right), #6454ef 0%, #316ce8 100%);
background: -webkit-gradient(linear, left top, right top, from(#6454ef), to(#316ce8));
background: -webkit-linear-gradient(left, #6454ef 0%, #316ce8 100%);
background: -o-linear-gradient(left, #6454ef 0%, #3021ec 100%);
background: linear-gradient(to right, #6454ef 0%, #3021ec 100%);
color: #ffffff;
border-radius: 1rem;
padding: .15rem .275rem;
line-height: 1;
font-weight: bold;
}
黄色
.primary-menu small {
display: inline-block;
-webkit-transform: translateY(-12px);
-ms-transform: translateY(-12px);
transform: translateY(-12px);
font-size: .75rem;
letter-spacing: 0.05em;
background: #f9e1be;
background: -webkit-linear-gradient(legacy-direction(to right), #efd3b0 0%, #f9e1be 100%);
background: -webkit-gradient(linear, left top, right top, from(#efd3b0), to(#f9e1be));
background: -webkit-linear-gradient(left, #efd3b0 0%, #f9e1be 100%);
background: -o-linear-gradient(left, #efd3b0 0%, #f9e1be 100%);
background: linear-gradient(to top, #efd3b0 0%, #f9e1be 100%);
color: #ffffff;
border-radius: 1rem;
padding: .15rem .275rem;
line-height: 1;
font-weight: bold;
}
如果你用的是B2主题,可以替换为:#top-menu-ul small{
本站有改动,改动代码如下:
<small class="superscript">tool</small>
css样式:
/*---顶部菜单文字角标---*/ /*small标签通用:蓝色*/ .superscript { display: inline-block; -webkit-transform: translateY(-12px); -ms-transform: translateY(-12px); transform: translateY(-12px); font-size: .75rem; letter-spacing: 0.05em; background: #188ef4; background: -webkit-linear-gradient(legacy-direction(to right), #6454ef 0%, #316ce8 100%); background: -webkit-gradient(linear, left top, right top, from(#6454ef), to(#316ce8)); background: -webkit-linear-gradient(left, #6454ef 0%, #316ce8 100%); background: -o-linear-gradient(left, #6454ef 0%, #3021ec 100%); background: linear-gradient(to right, #6454ef 0%, #3021ec 100%); color: #ffffff; border-radius: 1rem; padding: .15rem .275rem; line-height: 1; font-weight: bold; } /*第一个元素特定黄色*/ .superscript:first-child { display: inline-block; -webkit-transform: translateY(-12px); -ms-transform: translateY(-12px); transform: translateY(-12px); font-size: .75rem; letter-spacing: 0.05em; background: #f9e1be; background: -webkit-linear-gradient(legacy-direction(to right), #efd3b0 0%, #f9e1be 100%); background: -webkit-gradient(linear, left top, right top, from(#efd3b0), to(#f9e1be)); background: -webkit-linear-gradient(left, #efd3b0 0%, #f9e1be 100%); background: -o-linear-gradient(left, #efd3b0 0%, #f9e1be 100%); background: linear-gradient(to top, #efd3b0 0%, #f9e1be 100%); color: #ffffff; border-radius: 1rem; padding: .15rem .275rem; line-height: 1; font-weight: bold; }