WordPress如何删除文章元素白色背景

时间:2019-01-18 22:57:47

标签: html wordpress

我正在尝试删除wordpress文章(页面)的白色背景,而不是正文背景,即元素的背景。我希望文章文字没有白色背景,只有正文背景。

我尝试了很多“外部CSS”,但是没有人为我工作。

   article.post-1 { //just an example, I've tryed many other elements
     background-color: transparent;
   }

https://i.imgur.com/gJtqjpP.jpg您可以看到TEXT后面的白色背景,我将删除该白色并直接在背景图像上看到TEXT。在首页中。

2 个答案:

答案 0 :(得分:1)

我通过在CSS代码之后添加!important实现了这一目标:

element {

 background-color: transparent !important;

}

答案 1 :(得分:0)

首先,您应该检查页面的代码以找出应用背景的类,然后您可以设置background:透明(而不是background-color,因为它仅适用于颜色值)。