Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Tom Coady
369 PointsThank you everyone I have managed to remove the underline but still can't create centered text or coloured hover states.
I managed to remove the underline from my text links but can't seem to center the text or create coloured hover or selected states. Can anyone help?
5 Answers
Andreas Anastasiades
2,916 PointsCan you post your code?
for the color, have you used an !important anywhere?
Otherwise this should do:
a {color: #000;}
a:hover {color: #F00;}
For centering, depends on what you want to center where and how... That's why I ask for your code snippet
could be, for example:
a {text-align: center}
or
a {margin: 0 auto; width: 200px;}
Andreas Anastasiades
2,916 Pointslinks don't seem to work for me. Can you paste your code here?
Tom Coady
369 PointsAndreas Anastasiades
2,916 PointsHi Tom
You are using .hover, this should be :hover
nav a.visited {
color: #414042;
}
nav a.selected, nav a.hover {
color: #414042;
}
should be
nav a:visited {
color: #414042;
}
nav a.selected, nav a:hover {
color: #414042;
}
Only selected should be a class
You also have these classes defined as such:
<span style="color:#ffffff;" class="selected;" class="hover;">
should be
<span style="color:#ffffff;" class="selected hover">
No semicolon behind it and multiple classes should be divided with spaces.
Also since hover is no class anymore it should be:
<span style="color:#ffffff;" class="selected">
Tom Coady
369 PointsHi Andreas
Thank you very much again.
I'll apply these styles and see how things go. It obviously takes quite a lot of practice to remember these nuances in coding.
Cheers
Tom
Tom Coady
369 PointsActually I just tried that and it doesn't seem to be changing the role over or clicked state. Sorry! not sure what I am doing wrong still.
Code below:
Andreas Anastasiades
2,916 Pointsworkspace doesn't seem to work
Tom Coady
369 PointsTom Coady
369 PointsHi Andreas
Thank you for getting back to me. I have attached the code below and followed the tutorial as it outlined. Perhaps you can see what I am missing.
I also want to center the pictures on my website.
Many thanks
Tom
https://w.trhou.se/dztq7jq1j1 https://w.trhou.se/7ofxqh3w6b