hexo+next博客美化——自定义样式

5 篇文章 0 订阅
1 篇文章 0 订阅

我们调整样式的时候也不要直接操作next主题下的样式文件,将自定义文件与主题文件分开无疑是个很好的选择,我们在博客目录下的source新增一个_data目录,在该目录下新建styles.styl,这个文件将存放我们自定义的样式,然后在备用主题配置文件中custom_file_path选项里面讲style那一行取消注释。以下样式作参考,需要的大佬可以拷贝过去自行尝试!

//背景图片
body {
  background :url(https://xxxx);
  height:100%;
  width:100%;
  background-repeat:repeat-x;
  background-attachment:fixed;
  background-size:100% 100%;
}
//首页文章描述
blockquote p{
 font-size: 16px;
}
//阅读全文按钮样式
.post-button .btn{
    color: #555 !important;
    background-color: rgb(255, 255, 255);
    border-radius: 3px;
    font-size: 15px;
    box-shadow: inset 0px 0px 10px 0px rgba(0,0,0,0.35);
    border: none  !important;
    transition-property: unset;
    padding: 0px 15px;

}
.post-button .btn:hover{
    color: rgb(255,255,255) !important;
    border-radius: 3px;
    font-size: 15px;
    box-shadow: inset 0px 0px 10px 0px rgba(0,0,0,0.35);
    background-image: linear-gradient(90deg,#5587CE 0%,#21487a 25%,#3537a5 50%,#21487a 75%,#5587CE 100%);
    

}
//修改链接选中样式
a,span.exturl{
  border-bottom: none;
  &:hover {
     color: #ff106c;  
}
}



//修改选中字符的颜色
::selection {
  background: #26a69a;
  color: #ffffff;
  font-weight: 900;
  font-size: 32px;
}
::-moz-selection {
  background: #26a69a;
  color: #ffffff;
  font-weight: 900;
  font-size: 32px;
}


//去掉顶部黑线
.headband{
  display: none;
}

//修改选中字符的颜色
::selection {
  background: #26a69a;
  color: #ffffff;
  font-weight: 900;
  font-size: 32px;
}
::-moz-selection {
  background: #26a69a;
  color: #ffffff;
  font-weight: 900;
  font-size: 32px;
}

//博客内容透明化
//菜单栏的透明度设置
.header .header-inner {
  background: rgba(255,255,255,0.85);
  margin-top: 20px;
  overflow: hidden;
}
//文章内容的透明度设置
.main-inner {
  opacity: 0.9;
}
//侧边框的透明度设置
.sidebar {
  background rgba(255,255,255,0)
}
.sidebar-inner{
  background: rgba(255,255,255,0.85);
}

.site-brand-container{
   
   opacity: 0.8;
}

//页面内容框样式
.post-block{
margin-top: 40px;
margin-bottom: 30px;
margin-left: 20px;
}

hr{
  margin-top: 10px;
  margin-bottom: 10px;
}
.posts-expand .post-meta {
margin-bottom: 10px;
}

.back-to-top{
background: rgba(255,255,255,0)
}


//标签页面样式
.tag-cloud a{
    box-shadow: 0 1px 3px  #5587CE,0 1px 2px  #5587CE;
    padding: 2px 10px;
    margin: 8px;
    background: rgba(193, 66, 92, 0);
    border-bottom: none;
    border-radius: 20px;

}

// 分类&&标签 页面样式
.post-block.page {
    margin-top: 40px;
}

.category-list {
    overflow: auto;
}
.category-list li {
    height: 100%;
    float: left;
    border-right: 3px solid #222;
    padding: 0 20px;
}
.category-list li a:hover {
    color: black;
}
.category-list li.active a {
    font-weight: bold;
    color: black;
}
//页脚文字颜色
.footer-inner{

  color: #ffffff;
}

样式大概就这些,这些在我博客已经是调整好的了,但是我不敢保证在其他的博客网站上可以完全正常,所以拷贝的话需要做测试才行!
我的博客:https://blog.z7sz.top

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

xingyuzhongxuan

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值