如何覆盖现有的CSS [英] How do I override exisiting CSS

查看:152
本文介绍了如何覆盖现有的CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是所有这一切的新手。我只需要知道如何在我的孩子主题中编辑任何css。我尝试按照我发现的一些说明进行操作,但没有任何改变。



具体来说,我试图让所有页面标题都居中。



你们其中一个人可以看看我的网站,看看是否有任何明显的问题?这将不胜感激。谢谢!



我的网站(不判断):http://coopboardgames.com/



我尝试了什么:



在我的孩子css文件中,我尝试过:



.page-header .entry-title,.page-header .page-title {

text-align:center;

}

解决方案

您的Web应用程序中有一个文件style.css。该文件包含此样式的源代码。您应该将该代码添加到该文件中;我不确定为什么你的代码不起作用。我使用相同的代码,它的工作原理。我认为你没有将样式表链接到HTML文档。



我在HTML检查器中使用了以下CSS:

 page-header  entry-title ,。 page-header  page-title  {
margin-bottom 0px;
font-size 24px;
font-weight 600;
letter-spacing 1px;
text-transform 大写;
text-align center; / * 风格* /
}



它就像一个魅力。您可以在此屏幕截图中看到它,屏幕截图(3524).png - Google云端硬盘 [ ^ ]


I'm new to all of this. I just need to know how to edit ANY css in my child theme. I tried to follow some instructions I found, but nothing is changing.

Specifically, I'm trying to get all of the page headers to be centered.

Can one of you guys take a look at my site to see if there are any obvious issues? It would be greatly appreciated. Thanks!

My site (don't judge): http://coopboardgames.com/

What I have tried:

In my child css file, I tried:

.page-header .entry-title, .page-header .page-title {
text-align: center;
}

解决方案

There is a file, style.css, in your web application. That file contains the source code for this style. You should add that code to that file; I am not sure why your code didn't work. I used the same code, and it works. I think you didn't link the stylesheet to the HTML document.

I used the following CSS in the HTML inspector:

.page-header .entry-title, .page-header .page-title {
    margin-bottom: 0px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center; /* The style */
}


And it works like a charm. You can see it working in this screenshot image, Screenshot (3524).png - Google Drive[^]


这篇关于如何覆盖现有的CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆