php - 在 wordpress 或 php/css 中更改横幅文本颜色

标签 php html css wordpress

<分区>


关闭 6 年前

我是 php(和一般代码)的新手,遇到了一个问题..

我正在为我的网站使用 WordPress,我正在尝试更改 banner 中的文本颜色在页面顶部。我可以在 WordPress 中执行此操作,但是每当我这样做时,它都会在主菜单上四处移动文本。不知道为什么会这样。

所以我要么在 WordPress 中寻找解决此问题的方法,要么更简单的方法是仅更改 .php 页面中的字体颜色。

任何帮助将不胜感激

编辑*

不完全确定这个问题的哪一部分是题外话,因为它完全是关于一个主题:How to change the color of the text within a banner, within wordpress..Whether that is through wordpress itself, or the back -结束,我不在乎。无论如何都能完成工作。

无论如何,here是网站的链接,下面是 style.css 页面。

如果这还不够好,并且需要“main.min.css”,请告诉我

@import 'layout/css/main.min.css';

#menu-item-27 span {color: #000;}

#contact-front{
	border: 0px !important;
	color: #fff !important;
    	text-align: center !important;
}

#contact-contact{
	border: 0px !important;
	color: #000 !important;
    	text-align: center !important;
}

#contact-us-page .section-content .wpcf7-form p .wpcf7-textarea {
	color: #fff !important;
}

最佳答案

这是因为您使用的是 p 标签,它可能有填充/边距。

您可以将其替换为<span style="color:black">Training</> ,但这不是设置元素样式的最佳方式。

将以下 css 添加到您的 style.css

#header .top-header .header-navigation ul li.menu-item-has-children a {
    padding-right: 0;
    position: static;
}
#header .top-header .header-navigation ul li { padding-right: 16px }
#header .top-header .header-navigation ul li.menu-item-has-children a:after { top: -2px; }

关于php - 在 wordpress 或 php/css 中更改横幅文本颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38444535/

上一篇:css - 背景图像在 css 中无法正常工作

下一篇:html - 如何对齐 div 中的内容

相关文章:

iphone - 调整 iPad CSS 布局以适应 iPhone 屏幕

javascript - 为什么模板包含文件不起作用

php - 如何将PHP排序替换为SQL?

php - Html5 联系表 - javascript 和 php 验证问题

php - 我想获取一个 id 的所有父 id 的数组

javascript - 如何使用jquery根据屏幕宽度更改div的类

javascript - 鼠标悬停在菜单上无法正常工作

c# - 将 svg 的大小保持在 html 页面中

javascript - 从右到左出现的 div 部分

php - 限制选择复选框(一次一个类别和一个子类别)