wordpress美化为文章正文标题、二级标题、三级标题增加底色

Auth:老张       Date:2018/11/12       Cat:电脑网络       Word:共1453字

◷2018/11/12   👁浏览:7.2K   🗨4条评论
文章目录 「隐藏」
  1. 正文标题增加底色
    1. 二级标题、三级标题增加底色方法

为了增加文章内容的层次感,增强用户体验,我们可以把文章正文标题、二级标题、三级标题增加不同的底色这样的wordpress美化效果以示区分。

正文标题增加底色

在Style.css查找以下内容

  1. /** 正文 **/
  2. .entry-header h1 {
  3.     positionrelative;
  4.     font-size20px;
  5.     font-size: 2.0rem;
  6.     line-height30px;
  7.     text-aligncenter;
  8.     margin35px 0 0 0;
  9.     padding5px 0;
  10. }

替换为

  1. .entry-header h1 {
  2.     positionrelative;
  3.     font-size20px;
  4.     font-size: 1.8rem;
  5.     line-height30px;
  6.     text-aligncenter;
  7.     margin35px -20px 0 -20px;
  8.     padding5px 20px;
  9.     heightauto;
  10.     color#fff;
  11.     text-transform: inherit;
  12.     background-color#1ba1e2;
  13.     border-bottom1px solid #ddd;
  14. }

二级标题、三级标题增加底色方法

将以下代码

  1. /** 排版样式 **/
  2. .single-content h2 {
  3.     font-size17px;
  4.     font-size: 1.7rem;
  5.     line-height: 190%;
  6.     margin10px -21px;
  7.     padding: 0 44px;
  8.     border-left5px solid #e40000;
  9. }
  10. .single-content h3 {
  11.     font-size16px;
  12.     font-size: 1.6rem;
  13.     line-height: 190%;
  14.     margin2px -21px 10px -21px;
  15.     padding: 0 44px;
  16.     border-left5px solid #3690cf;
  17. }

替换为

  1. .single-content h2 {
  2.     font-size17px;
  3.     font-size: 1.7rem;
  4.     line-height: 190%;
  5.     margin10px -20px;
  6.     padding: 0 44px;
  7.     border-left5px solid #e40000;
  8.   background-color#ebebeb;
  9.     border-bottom1px solid #e40000;
  10. }
  11. .single-content h3 {
  12.     font-size16px;
  13.     font-size: 1.6rem;
  14.     line-height: 190%;
  15.     margin2px -20px 10px -20px;
  16.     padding: 0 44px;
  17.     border-left5px solid #3690cf;
  18.     background-color#ebebeb;
  19.     border-bottom1px solid #3690cf;
  20. }
增加底色可以很好的增强文章内容的层次感,增强了用户体验。

wordpress美化为文章正文标题、二级标题、三级标题增加底色 - 第1张图片

 

 

《wordpress美化为文章正文标题、二级标题、三级标题增加底色》留言数:4

发表留言