Html/css hyperlink color problem

+1 Stelios Anonymos · June 25, 2015
Hey guys, i start learning html/css about a week ago and i am kinda stack.

When i open my website on my local computer all the links looks red. I am trying to fix it for 3 hours now but without any progress.
The weird thing is that when i put my code into codepen(i found out about this just now, because i wanted to share my code with you) it looks just fine. 

http://codepen.io/anon/pen/qdVyVE

Do you know what's goin on ? 
Thanks in advance.

P.S I know that my page looks bad, i am just checking my skills so far. :)

Post a Reply

Replies

Oldest  Newest  Rating
+2 Alan Johnson · June 25, 2015
These three rules will target absolutely any <a>
a:visited,
a:hover,
a:active

Remove them if you just want the <a> inside .content
+1 Alan Johnson · June 25, 2015
Yes for example if you wanted those styles for only <a>'s inside .content then:

.content a:link,
.content a:visited,
.content a:hover,
.content a:active {
text-decoration: none;
color: red;
}
0 Alan Johnson · June 25, 2015
Your links are all red because you've applied this style: 

.content a:link,
a:visited,
a:hover,
a:active {
text-decoration: none;
color: red;
}

Change the color or remove that styling if you want it differently.
0 Stelios Anonymos · June 25, 2015
Yeah, but why does this effect my whole page and not just the <a> inside the .content ?
0 Stelios Anonymos · June 25, 2015
Neat, thanks ! Is there anyway to use those selectors and 'lock' them to target only some specific elements ?
0 Stelios Anonymos · June 26, 2015
Oh, i see. Thank you !
  • 1

HTML / CSS / Web Design

107,323 followers
About

Discuss, share, ask, learn and teach HTML5 and CSS3.

Links
Moderators