2 replies [Last post]
Kerusso1
Kerusso1's picture
Offline
newbie
Mississippi
Last seen: 8 years 29 weeks ago
Mississippi
Timezone: GMT-6
Joined: 2014-01-12
Posts: 1
Points: 2

I use heading tags h1 - h6 in my documents and I have them set with css for different colors and underlines. I have also added an anchor tag to go to an html document for my table of contents based on these headings. When using the anchor tag it changes the color of my heading tags. I want to be able to use css to change just the anchor tags I have used on the headings without affecting any other anchor taq in my document. Is this possible?

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 week 2 days ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5344
Points: 2965

Hi Kerusso1, you just need to

Hi Kerusso1,

you just need to target the links within the headings.
So when you have h1{ use h1, h1 a{ you will have to override any link styles and the pseudo classes hover, visited etc.

sudhakar12
sudhakar12's picture
Offline
newbie
Bangalore
Last seen: 8 years 27 weeks ago
Bangalore
Timezone: GMT+5.5
Joined: 2014-01-28
Posts: 4
Points: 4

Try do this code

If you want h1 tag mean you create a h1 a{background-color:red;}. Try do in this code.