开发者

Header is displaying link color

开发者 https://www.devze.com 2023-01-03 21:59 出处:网络
Let me start by saying I am a CSS newb.I am using wordpress and my post heading (h2) is displaying the color of the links on the page.I would like to keep all h2 headings black while all other links w

Let me start by saying I am a CSS newb. I am using wordpress and my post heading (h2) is displaying the color of the links on the page. I would like to keep all h2 headings black while all other links would be red. When changing the link color in the css, it开发者_开发技巧 also displays the post heading red as well.

How can I override this? I am sure this is something simple.

Thanks in advance for any help.


You need to show some HTML to get a definitive answer, but to colour all links in h2s green:

h2 a { color: green }

If your h2s have a certain class, you can drill it down to that specific class:

h2.classname a { color: green }


Replace '#color' with your hex digit.

h2 a { color: #color }

You may have to put !important after the color if something else is overriding or if its done in the wrong place.


maybe something like this can help you.

/* link color */

h2 a, h2 a:visited
{
    color:#f0f0f0 !important;
}

/* link color on hover(Mouseover) */

h2 a:hover
{
    color:#000000 !important;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消