在提高文章内容质量的基础上,我还遵从一个原则,就是排版要一致和有条理。换过自己喜欢的Zblog主题风格之后,排版问题随之而来,因为默认的排版风格不一样让自己喜欢。那么,首先文章页面排版首当其冲的是“首行缩进”和“段落间距”,Z-blog的“首行缩进”我没有使用,但是也在此做下介绍,以期待帮助初用z-blog的朋友。“段落间距”一般主题有默认风格,我用的这款主题没有,所以也算在此做下备份。
Z-blog的“首行缩进”
找到以下代码:
div.post-body p{}
形如
div.post-body p{
margin:10px 0 15px 0;
padding:0;
line-height:130%;
}
添加text-indent: 2em;
这段CSS代码是定义文章风格的,其中 text-indent是定义段落首行缩进的代码,2em是两个字符。因此如果你的div.post-body p{}的大括号中没有text-indent或者text-indent: 0em,那么你就要添加或者修改为text-indent: 2em;顺便line-height:130% 是定义行间距的。
成为
div.post-body p{
margin:10px 0 15px 0;
padding:0;
text-indent: 2em;
line-height:130%;
}
Z-blog的“段落间距”
同样找到上述代码,div.post-body p{}如下:
div.post-body p{
margin:10px 0 15px 0;
padding:0;
text-indent: 2em;line-height:130%;
}
上面的代码内容不管是否跟你的一样,在里面添加
margin-top: 15px;
margin-bottom: 15px;
即:
div.post-body p{
margin:10px 0 15px 0;
padding:0;
text-indent: 2em;line-height:130%;
margin-top: 15px;
margin-bottom: 15px;
}
修改之前记得备份自己的CSS,希望看到本文对你有所帮助。
原创文章如转载,请注明:转载自 袋鼠在线[http://www.nsoom.cn/ ]
原文地址:http://www.nsoom.cn/post/zblog-css-margin-top-meihua.html
