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>
标题和内容部分可以随便填内容,上面的那个整体框架不能变。
四,其他
配置好上面的之后可以开始写文章了,但是上面那个有个小问题就是:有时候对不齐全,如图:
可以看到信封的线和文字不对齐,不过感觉问题也不大。
然后就是可以用这个当标签用,比如把下面的
标签
代替成
标签