Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Change Border Color on Hover

Tags:

css

I'm using the following CSS code to create a box around some content/links:

.box {
    border-top-left-radius: 25px;
    border-top-right-radius: 25px;  
    border: 2px solid #000000;
    padding: 5px 40px; 
    background: #ffffff;
}

I want to make it so that when the mouse cursor hovers over the box, the black border color changes to purple.

like image 768
user3216933 Avatar asked Jan 20 '14 22:01

user3216933


2 Answers

Use the :hover psuedo selector:

.box:hover {
   border-color: purple;
}
like image 85
Axel Avatar answered Nov 03 '22 11:11

Axel


Very easy, just apply the selector :hover

.box:hover {
    border:5px solid #b217b4;
}

JSFiddle Here for you

like image 4
tim.baker Avatar answered Nov 03 '22 10:11

tim.baker