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
Shaun Kelly
35,560 PointsHelp with social icons - CSS
Hi guys,
Im re-designing my portfolio website and have just added my social icons however when i hover over one of them...all four appear. Could someone take a look at my source and tell me where I'm going wrong. I need them to appear individually when i hover over them.
http://portfoliosdk.esy.es Thanks in advance.
Shaun
2 Answers
Andrew Stelmach
12,583 PointsLooking at your html, I'm sure the main problem is that all of your links are encapsulated in the one 'social-icons' div. I'm sure the CSS and/or Javascript will be setup for that div to move on hover, bringing all of its contents (your links) with it.
Omeiza Owuda
Courses Plus Student 80 PointsHello shaun, why not do something like this.
social-icons a {
display: block; }
social-icons a:hover > #email {
margin-right: 0px;
}
social-icons a:hover > #treehouse {
margin-right: 0px;
}
and so on
You can also use javascript "this".
Shaun Kelly
35,560 PointsShaun Kelly
35,560 PointsHi mate,
Im not following. I have the CSS set up individually for each social icon. The only CSS i have set up for the 'social-icons' div is positioning so i don't understand why they are being grouped.