Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Social Link hover over effect

Featured Replies

Good evening,

 

I am trying to modify social icons. Currently they have no hover/rollover effect.

 

I would like it so that the icon changes color on hover. I am sure I have done this before but I just can't seem to get it in the bag.

 

The URL is http://charlyanderson.co.uk/homewatch/

 

HTML is:-

 

<div class="social-icons">

    <ul>

        <li class="social_icon"><a href="http://twitter.com/home?status=Reading%20-%20http://your-website-url.com/" title="Twitter" target="_blank"><img src="http://www.charlyanderson.co.uk/homewatch/wp-content/themes/u-design/styles/common-images/twitter-icon.png" alt="twitter" border="0" /></a></li>

        <li class="social_icon"><a href="http://www.facebook.com/sharer.php?u=http://your-website-url.com/" title="Facebook" target="_blank"><img src="http://www.charlyanderson.co.uk/homewatch/wp-content/themes/u-design/styles/common-images/facebook-icon.png" alt="facebook" border="0" /></a></li>

        <li class="social_icon"><a href="http://www.linkedin.com/shareArticle?mini=true&url=CONTENT-URL&title=CONTENT-TITLE&summary=DEATILS-OPTIONAL&source=YOURWEBSITE-NAME" title="LinkedIn" target="_blank"><img src="http://www.charlyanderson.co.uk/homewatch/wp-content/themes/u-design/styles/common-images/linkedin-icon.png" alt="linkedin" border="0" /></a></li>

        <li class="social_icon"><a href="http://your-website-url.com/?page_id=5#contact-wrapper" title="E-mail"><img src="http://www.charlyanderson.co.uk/homewatch/wp-content/themes/u-design/styles/common-images/email-icon.png" alt="email" border="0" /></a></li>

        <li class="social_icon"><a href="http://your-website-url.com/?feed=rss" title="RSS" target="_blank"><img src="http://www.charlyanderson.co.uk/homewatch/wp-content/themes/u-design/styles/common-images/rss-icon.png" alt="rss" border="0" /></a></li>

    </ul>

</div>

CSS:-

 

#top-elements .social-icons {
    display: block;
    float: left;
}
#top-elements .social-icons ul {
    list-style-image: none;
    list-style-position: outside;
    list-style-type: none;
    text-align: right;
    padding: 5px 0 0 0;
    float: right;
    margin-bottom: 0;
}
#top-elements .social-icons li.social_icon {
    background: none repeat scroll 0 0 transparent !important;
    padding-left: 0 !important;
    display: inline;
    float: left;
    margin-left: 6px;
}
#top-elements .social-icons a {
    overflow: hidden;
    outline: none;
}
#top-elements .social_media_top { 
    padding:0 20px 0 0;
    float:right;
    clear:both;
}
#top-elements .social_media_title {
    text-align:center;
    color: #999999;
    padding:0;
    margin:0;
}

 

I figured that if I:-

 

1) Replace image URL in html to text

2) Indent text so you can't see it

3) Add additional class to html li e.g .facebook

4) Add additional css class for .facebook & .facebook a:hover

5) Remove background:none from CSS

 

That this would work... but it doesn't. the images were there but no link....

 

Can anyone help

Lots of ways you could do this. Here's two, there are as I say many more.

 

This uses inline image and applies an opacity change on hover:

 

 

<div class="social-links">
            <a class="social-links-item" title="Twitter" href="http://twitter.com/"><img src="images/icons/twitter_32.png" alt="twitter icon" /></a>
            <a class="social-links-item" title="Facebook" href="http://www.facebook.com/"><img src="images/icons/facebook_32.png" alt="facebook icon" /></a>
            <a class="social-links-item" title="Youtube" href="http://www.linkedin.com/"><img src="images/icons/linkedin_32.png" alt="linkedin icon" /></a>
            <a class="social-links-item" title="Github" href="#nogo"><img src="images/icons/rss_32.png" alt="RSS icon" /></a>
            <a class="social-links-item" title="Google Groups" href="#nogo"><img src="images/icons/email_32.png" alt="email icon" /></a>
        </div>
 

CSS:

 

 

.social-links{
float:right;
width:230px;
}

.social-links-item {
float:left;
display: block;
height: 32px;
margin-left: 13px;
width: 32px;
}
a img {
border: none;
outline:none;
}
.social-links-item img{
display:block;
opacity: 0.6;
transition: opacity 300ms ease-out 0s;
}
.social-links-item img:hover {
opacity: 1;
transition: opacity 300ms ease-out 0s;
}
 

The following method sets the images as backgrounds:

 

 

        <div class="social-links">
            <a class="social-links-item twitter-icon" title="Twitter" href="http://twitter.com/">Twitter</a>
            <a class="social-links-item facebook-icon" title="Facebook" href="http://www.facebook.com/">Facebook</a>
            <a class="social-links-item linkedin-icon" title="Youtube" href="http://www.linkedin.com/">LinkedIn</a>
            <a class="social-links-item rss-icon" title="Github" href="#nogo">RSS</a>
            <a class="social-links-item mail-icon" title="Google Groups" href="#nogo">Email</a>
        </div>
 

CSS:

 

 

.social-links{
float:right;
}
.twitter-icon {
background: url(images/icons/twitter_32.png)no-repeat top center;
}
.facebook-icon {
background: url(images/icons/facebook_32.png)no-repeat top center;
}
.linkedin-icon {
background: url(images/icons/linkedin_32.png)no-repeat top center;
}
.rss-icon {
background: url(images/icons/rss_32.png)no-repeat top center;
}
.mail-icon {
background: url(images/icons/email_32.png)no-repeat top center;
}
.social-links-item {
display: inline-block;
height: 32px;
margin-left: 13px;
opacity: 0.5;
text-indent: -99999px;
transition: opacity 300ms ease-out 0s;
vertical-align: middle;
width: 32px;
}
.social-links-item:hover {
opacity: 1;
transition: opacity 300ms ease-out 0s;
}
 

Note that no lists ordered, unordered or otherwise were used in the making of these.

 

Attached is a zip file which includes both methods and the some icons.

 

 

wdf-image-hover-effect.zip

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.