博客园-主题自定义
博客样式
样式修改
在iMetro_HD
基础上通过自定义css样式
和html头部
实现对主题的修改
css 样式如下
body {
font-size:12pt;
text-align:center;
}
/* header样式 */
.banner {
background:#fff;
margin:15px auto 0;
max-width:1225px;
text-align:left;
padding-top:5px
}
.blogsTitle {
font-family:Verdana,Arial,Helvetica,sans-serif;
font-size:48px;
color:#000;
padding:15px 30px 20px;
border-left:15px solid #f80000;
margin-bottom:5px;
}
/* 导航栏样式 */
ul#nav {
width:100%;
height:60px;
background:#37B45D;
margin:0 auto
}
ul#nav li {
display:inline;
height:60px
}
ul#nav li a {
display:inline-block;
padding:0 20px;
height:60px;
line-height:60px;
color:#FFF;
font-family:"\5FAE\8F6F\96C5\9ED1";
font-size:18px
}
ul#nav li a:hover {
background:#2E9B4F
}/*设置鼠标滑过或悬停时变化的背景颜色*/
/* 页面主体样式 */
#home {
margin:0px auto 15px;
max-width:1200px;
text-align:left;
box-shadow:none;
}
#blogTitle {
display:none;
}
#navList {
display:none;
}
#main {
font-size:14px;
}
.dayTitle {
display:none;
}
.day {
border-bottom:1px dashed #aaa;
}
.postSeparator {
border-bottom:1px dashed #aaa;
}
.postTitle {
background-image:none;
border-left:10px solid #37b45d;
}
.postTitle a:link {
color:#37b45d;
}
.postTitle a:visited {
color:#37b45d;
}
.postTitle a:hover {
color:#37b45d;
}
.postTitle a:active {
color:#37b45d;
}
#leftcontentcontainer>div {
border:1px dashed #777;
}
/* 正文内容样式 */
#cnblogs_post_body h1 {
margin:20px 0;
border-left:4px solid green;
border-bottom:green 1px dashed;
padding-left:10px;
}
#cnblogs_post_body h2 {
margin:20px 0;
border-bottom:1px dashed rgba(0,130,0,0.28);
padding-left:10px;
}
/* 侧边栏 */
#sideBar {
font-size:12px;
}
.catListTitle {
color:red;
border-bottom:1px solid red;
margin:10px auto;
font-weight:bold;
}
.newsItem {
border:1px solid #777;
}
/*自定义样式*/
span#inline-yellow, span#inline-green, span#inline-blue, span#inline-purple, span#inline-red{
display:inline;
padding:.2em .6em .3em;
font-size:80%;
font-weight:bold;
line-height:1;
color:#fff;
text-align:center;
white-space:nowrap;
vertical-align:baseline;
border-radius: 2px;
}
span#inline-yellow {
background-color:#f0ad4e;
}
span#inline-green {
background-color:#5cb85c;
}
span#inline-blue {
background-color:#2780e3;
}
span#inline-purple {
background-color:#9954bb;
}
span#inline-red {
background-color:#df3e3e;
}
/* 边框左侧加粗样式 */
p#div-border-left-red, p#div-border-left-yellow, p#div-border-left-green, p#div-border-left-blue, p#div-border-left-purple {
display:block;
padding:10px;
margin:10px 0;
border:1px solid #ccc;
border-left-width:5px;
border-radius:5px;
line-height: 1.8;
font-size: 110%;
background: #F0F0F0;
}
p#div-border-left-red {
border-left-color:#df3e3e;
}
p#div-border-left-yellow {
border-left-color:#f0ad4e;
}
p#div-border-left-green {
border-left-color:#5cb85c;
}
p#div-border-left-blue {
border-left-color:#2780e3;
}
p#div-border-left-purple {
border-left-color:#9954bb;
}
/* 边框右侧加粗样式 */
p#div-border-right-red, p#div-border-right-yellow, p#div-border-right-green, p#div-border-right-blue, p#div-border-right-purple{
display:block;
padding:10px;
margin:10px 0;
border:1px solid #ccc;
border-right-width:5px;
border-radius:5px;
line-height: 1.8;
font-size: 110%;
background: #F0F0F0;
}
p#div-border-right-red {
border-right-color:#df3e3e;
}
p#div-border-right-yellow {
border-right-color:#f0ad4e;
}
p#div-border-right-green {
border-right-color:#5cb85c;
}
p#div-border-right-blue {
border-right-color:#2780e3;
}
p#div-border-right-purple {
border-right-color:#9954bb;
}
/* 边框上方加粗样式 */
p#div-border-top-red, p#div-border-top-yellow, p#div-border-top-green, p#div-border-top-blue, p#div-border-top-purple{
display:block;
padding:10px;
margin:10px 0;
border:1px solid #ccc;
border-top-width:5px;
border-radius:5px;
line-height: 1.8;
font-size: 110%;
background: #F0F0F0;
}
p#div-border-top-red {
border-top-color:#df3e3e;
}
p#div-border-top-yellow {
border-top-color:#f0ad4e;
}
p#div-border-top-green {
border-top-color:#5cb85c;
}
p#div-border-top-blue {
border-top-color:#2780e3;
}
p#div-border-top-purple {
border-top-color:#9954bb;
}
/*---------------------------------------*/
/*去除文章页底部推广链接*/
.c_ad_block {
display:none;
}
/*设置评论框样式*/
div.commentform textarea {
width:95%;
height:150px;
font-size:16px;
padding:5px 10px;
border:1px solid #95c0f2;
border-radius:3px;
}
/*设置评论字体大小*/
div.feedbackItem div.feedbackCon {
font-size:16px;
}
/*新输入的评论框样式*/
.bq_post_comment {
border:1px solid #95c0f2;
}
/*评论中图片的大小*/
.blog_comment_body img {
margin-left:10px;
max-width:800px;
}
#comment_nav {
background-color: rgba(0, 128, 0, 0.87);
margin-top: 10px;
}
/*设置文章页相关内容*/
#author_profile {
display:none;
}
#div_digg {
display:none;
}
#ad_t2 {
display:none;
}
#under_post_news,#under_post_kb {
display:none;
}
input.author {
border:0px solid #ccc;
background-color:rgba(136,136,136,0);
}
html页首代码
<div class="banner">
<div class="blogsTitle">
<h1>lazyboy's 博客</h1>
</div>
<ul id="nav">
<li><a href="http://www.cnblogs.com/xbotao/">首页</a></li>
<li><a href>计算机视觉</a></li>
<li><a href="https://i.cnblogs.com/EditPosts.aspx?opt=1">新随笔</a></li>
<li><a href="https://i.cnblogs.com/">后台管理</a></li>
<li><a href="https://www.lazyboy.site/">Blog</a></li>
</ul>
</div>
侧边栏添加头像
<img class="mypicbox" src="https://pic.cnblogs.com/avatar/618511/20161115195153.png">
作者: mr-xbt
本文来自博客园: https://www.cnblogs.com/xbotao/p/6636651.html
如有问题,请留言或者Email我: upc_xbt 163.com