Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 代码帮助!我想为一个部分覆盖背景和悬停颜色_Html_Css - Fatal编程技术网

Html 代码帮助!我想为一个部分覆盖背景和悬停颜色

Html 代码帮助!我想为一个部分覆盖背景和悬停颜色,html,css,Html,Css,我试图复制一个菜单部分,但希望背景和悬停的颜色是相反的。CSS样式表/网站不是我创建的,我也不习惯编码 这一页正在进行中 但是我想让菜单改变两行的颜色,例如 .squareboxarchery{background-color:#546734;} .squareboxarchery:hover{background-color:#425227;} .squarearcherytitle{color:#ffffff;} and .squarebox{background-color:#42522

我试图复制一个菜单部分,但希望背景和悬停的颜色是相反的。CSS样式表/网站不是我创建的,我也不习惯编码

这一页正在进行中

但是我想让菜单改变两行的颜色,例如

.squareboxarchery{background-color:#546734;}
.squareboxarchery:hover{background-color:#425227;}
.squarearcherytitle{color:#ffffff;} 
and
.squarebox{background-color:#425227;}
.squarebox:hover{background-color:#546734;}
.squaretitle{color:#ffffff;} 
我不知道如何使它成为一个独立的实体。。。
任何帮助都将不胜感激

看看dom,我认为:

应该移动第二个div.fixed_site layer_包装,现在它位于第一个fixed_site layer_包装中;它的逻辑是两个相同的结构必须在同一个层次上

完成后,您可以通过以下方式轻松分离css:

/* applies to the first line */
div.fixed_site layer_wrapper squarebox {}


您正在使用wordpress主题。你需要登录你的CMS,做一些选择并保存页面。如果它不起作用,那么你需要为带有css属性的页面添加额外的css!覆盖背景颜色、文本颜色、悬停颜色等很重要

看起来会像

      .squareboxarchery{background-color:#425227;!important}
      .squareboxarchery:hover{background-color:#546734;!important}
      .squarearcherytitle{color:#ffffff;!important} 

从以上两组中选择您想要的


或者只需将行添加到style.css中即可。如果您使用的是CMS-Content-Manager系统,通常必须使用!在你的风格之后很重要。
但是还有另一种方法可以避免使用它!重要的。安装FileZilla,转到网站的main.css文件夹,手动更改代码行。然后在您的网站上再次上传此文件。但是要小心,如果您不使用此操作,请复制这些文件两次以确保安全。如果您犯了错误,您的计算机上总是有原件。

请阅读。当外部资源消失或固定时,依赖外部资源的问题将变得无用。创造一个答案,并把它放在问题本身中。你说的“相反”是什么意思?“两行”是什么意思?这是我的代码。。如何使任一部分具有squareboxarchery css?我编辑了样式css,复制了squarebox样式,并添加了“archery”,这样做对吗?我正在使用wordpress,并已将您的自定义代码放入自定义css部分。非常感谢大家的帮助!这对我来说是一个思维领域!
      .squareboxarchery{background-color:#425227;!important}
      .squareboxarchery:hover{background-color:#546734;!important}
      .squarearcherytitle{color:#ffffff;!important} 
     .squarebox{background-color:#546734;!important}
     .squarebox:hover{background-color:#425227;!important}
     .squaretitle{color:#ffffff;!important}