hexo页面仿信纸作业纸样式


hexo页面仿信纸作业纸样式

效果预览:

一,建立ejs文件

\matery\layout文件夹下新建一个essay.ejs文件,文件代码内容:

<%- partial('_partial/bg-cover') %>

<main class="content">
    <%- partial('_widget/essay-cloud') %>
</main>

二,增加css

到主题文件夹的\matery\layout\_partial中找到post-detail.ejs文件,打开在末尾加上一下代码:

代码
<style>
    .ititle {
        margin: 15px 0;
        text-align:center;
        font-family: 'Architects Daughter', cursive;
    }
    .ipage {
        line-height: 30px;
        margin: 0 auto;
        padding: 15px 32px 29px;
        background-color: #f9f9f9;
        box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.26);
        -moz-border-radius-bottomleft: 20px 500px;
        -moz-border-radius-bottomright: 500px 30px;
        -moz-border-radius-topright: 5px 100px;    
        -webkit-border-bottom-left-radius: 20px 500px;
        -webkit-border-bottom-right-radius: 64px 10px;
        -webkit-border-top-right-radius: 5px 100px;    
        border-bottom-left-radius: 20px 500px;
        border-bottom-right-radius: 64px 10px;
        border-top-right-radius: 5px 100px;           
        -webkit-background-size: 100% 30px;
        -moz-box-shadow: 0 2px 10px 1px rgba(0, 0, 0, 0.2);
        -webkit-box-shadow: 0 2px 10px 1px rgba(0, 0, 0, 0.2);
        text-shadow: 0 1px 0 #F6EF97;
        position: relative;
    }
.izhengwen {
    position: relative;
    top: 0;
    left: 0;
    z-index: 2;
    height: auto;
    background: repeating-linear-gradient(to bottom, #f9f9f9, #f9f9f9 31px, #6BA2D8 1px, #f9f9f9);
    background-size: 100% 32px;
}
#articleContent p {
    margin: 0
}
.ititle {
    font-family: 'Architects Daughter', cursive;
    font-size: 1.45rem!important;
    padding: 10px auto;
}
.izhengwen p {
    position: relative;
    line-height: 2.2rem!important;
    text-indent: 2em;
    font-family: 'Architects Daughter', cursive!important;
    font-size: 1.45rem!important;
}
.ipage::before {
    content: " ";
    display: inline-block;
    position: absolute;
    top: 0px;
    bottom: 0;
    right: 52px;
    z-index: 4;
    width: 4px;
    height: 100%;
    border-left: 1px solid #fca1a1;
}
.izhengwen p:nth-child(odd):before {
    content: " ";
    display: inline-block;
    position: absolute;
    top: 0;
    left: -16px;
    z-index: 3;
    width: 24px;
    height: 24px;
    background-color: #fff;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    box-shadow: inset 0px 2px 5px 0px rgba(0, 0, 0, 0.26);
}
.ipage:after {
    content: " ";
    display: inline-block;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 52px;
    z-index: 3;
    width: 4px;
    height: 100%;
    border-left: 4px double #fca1a1;
}
.ipage p {
    padding: 0 2em;
    color: #333!important;
}
body.dark .ipage {
    opacity: 0.85;
}
/*小屏幕下(手机类)的样式*/
@media only screen and (max-width: 600px) {
    .ipage {
        padding: 15px 23px 29px;
    }
    .ipage:after {
        left: 36px;
    }
    .ipage::before {
        right: 36px;    
    }
    .ipage p {
        padding: 0 0.9em;
    }
}
</style>

三,写文章

按照下面的模板写

---
title: 标题
---
<div class="ipage">
    <div class="ititle">标题</div>
  <div class="izhengwen">
    <p>内容
    </p>
  </div>
</div>

标题和内容部分可以随便填内容,上面的那个整体框架不能变。

四,其他

配置好上面的之后可以开始写文章了,但是上面那个有个小问题就是:有时候对不齐全,如图:

可以看到信封的线和文字不对齐,不过感觉问题也不大。

然后就是可以用这个当标签用,比如把下面的

标签

代替成

标签


文章作者: 我心永恆
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 我心永恆 !
评论
 上一篇
关于bb短博文的说明 关于bb短博文的说明
最近在网上看到一个叫做“bb短博文的的文章”,所以自己折腾了一下出现了不少问题,这里记录一下 文章连接:https://www.heson10.com/posts/15701.html 效果预览 文章中写道可以利用”leanc
2021-05-31 我心永恆
下一篇 
猫盘nas的一些事(1) 猫盘nas的一些事(1)
数学物理方法——基础知识(1)本科期间学过数学物理方程,现在准备读研究生了,以后涉及到计算的方面比较多,因此现在我需要重新学习数学物理方程,捡回来原来的知识。 主要的参考书籍《数学物理方法》顾樵 [TOC] 第一章——基础理论知识1.1常微
2021-02-10 我心永恆
  目录