Two columns Three columns Mixed cols and rows Gallery Archives Clean & Clear Dark or Black High Contrast/ Impact Blog Designs New Corporate/ Professional Unconventional Designs Liquid layouts Web Design Firms Our Favorites What's Popular Last 20 submissions
Horizontal Menus Vertical Menus Multiple/ Nested Levels

CSS Examples Borderize links onMouseover

Date: 10/14/2004 Borderize links onMouseover

Author: CSS Drive

The goal of CSS link effects is often to draw attention to a link when the user hovers over it. Using the pseudo class "a:hover", this one applies a border to the target link, and for good measure, changes its background color as well. Notice how by setting the links to "display: block", the entire link area- and not just the text- becomes "active."

The HTML:

<div id="borderlinks">
<a href="http://www.cssdrive.com">CSS Drive</a>
<a href="http://www.javascriptkit.com/jsref/">JavaScript Reference</a>
<a href="http://www.google.com">Google</a>
<a href="http://www.yahoo.com">Yahoo</a>
</div>

The CSS:

#borderlinks a{
padding-left: 4px;
display: block;
width: 150px;
color: black;
text-decoration: none;
border: 1px solid white;
}

#borderlinks a:hover{
border: 1px solid black;
background-color: lightyellow;
}

Comments (11)

Good post! Thanks for the info

#1: Nikola on 08/26 at 08:15 AM

Yeah. great post. thanks

#2: gratis on 09/04 at 04:56 PM

simple and useful.

#3: roses on 09/20 at 03:36 AM

Great one.I am using it : ) thanks
Games

#4: John on 11/21 at 07:59 AM

Wonderful article, thank you so much.

#5: videolar on 12/04 at 10:58 AM

Thanks, very simple and usable and it looks great too. I love css and what you can do with it. It is much simpler than using javascript which I have a lot of trouble understanding.
Acne Treatments

#6: Jake on 12/13 at 03:25 AM

I love how easily you can use CSS to get some really cool mouseover effects. Thanks for the useful tips - I love your site, keep up the great work. - Editor (Make Money Online Site)

#7: Jenny P. on 01/15 at 05:41 AM

Damnit I have been trying to find that code forever - thanks~

#8: Money on 02/25 at 12:22 AM

thanks css drive. you are best!

#9: emlak on 03/04 at 09:01 AM

thaks

#10: hoteles madrid on 04/29 at 06:40 PM

Post a Comment: Guest (Login or Register)

Name: (Required)

Email: (Required)

(NOT shown on page)

URL:

(Shown on page if entered)

Comments: (Required)

Remember my personal information
Notify me of follow-up comments?

Submit the word you see below:


CSS Forums

CSS Forums: latest threads Last Post Info
Cant design (1) 05/16/2008 12:28 pm
By: tarik
How to show an entire pdf in one div (2) 05/14/2008 11:07 am
By: Grundic
Starting A Web Design Business - How Do I Attract Customers? (10) 05/13/2008 02:37 pm
By: april
Download.. Pacific Wings multicolor menu (1) 05/13/2008 03:05 am
By: sebreh
Check out this website I am working on CRITIQUE. (5) 05/13/2008 01:20 am
By: abran