自定义blog样式时,代码段的line-height继承样式post的line-height,间隔太大了,决定再减小点,css都玩了几年了,感觉中这是很容易的事情。然后,就悲剧了好久,原先自定义样式表为

.headermaintitle {
    font-family:"华文行楷",Verdana,Arial,Helvetica,sans-serif;
    font-size:50px;
}
.headerDis {
    font-family:"华文行楷",Verdana,Arial,Helvetica,sans-serif;
    font-size:20px;
    text-align:center;
}
body {
    font-size:12px;
}
.mySearch {
    display:none;
}
.postCon {
    font-size:12px;    
}
.c_b_p_desc {
    line-height:24px;
}
.day {
    margin-bottom:0;
}
.day center {
    display:none;
}
.postSeparator {
    display:none;
}
#left_border {
    height:auto;
}
#footer {
    display:block;
    text-align:center;
    padding:30px 0px 15px 0px;    
}
.post {
    font-size:12px;
    line-height:26px;
}
#cnblogs_post_body p {
    margin:0;
    padding:0;
}
#cnblogs_post_body a {
    color:blue;
}
#author_profile {
    display:none;
}
div.commentform textarea {
    width:100%;
}
.commentbox_title {
    width:100%;
}
#commentbox_opt {
    text-align:right;
}
#ad_under_post_holder {
    display:none;
}
.c_ad_block {
    line-height:20px;
}
#site_nav_under,#blog_news_kb {
    display:none;
}
.feedbackItem {
    border-bottom:1px dashed #ccc;
}
.feedbackCon {
    background:none;
}
.postTitle {
    padding: 22px 15px 10px 28px;.post pre {
    line-height:16px;
}

  我是觉得很正常啊,最后三行重写pre的行高,应该很顺利吧。但是。。。居然不起作用,疑惑了很久,一直无法解决。

  刚看完电视,无聊,就决定继续折腾,但是,死活还是不对,审查元素中,line-height属性能看到是取了样式post的,我前面是重写过post样式,但是后面再去重写post中的pre的行高为什么就不行????

  然后,猜想既然是用的post样式的,我紧跟着重写下pre的行高,应该问题不大吧。。。于是挪到了post样式后面,刷新。。。咦????好了!!!!

  只是把最后那个重新pre行高的样式挪到样式post后面,它咋就又能起作用了呢?????

  无解。。。。真是好基友啊,分开还不干活了!

 posted on 2014-08-07 23:41  往事如风  阅读(376)  评论(0编辑  收藏  举报