CSS Change Border Color on Hover

后端 未结 3 694
清歌不尽
清歌不尽 2021-01-17 10:14

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

.box {
    border-top-left-radius: 25px;         


        
相关标签:
3条回答
  • 2021-01-17 10:43

    You can use color instead of border-color which inherits the color of the border as well:

    .box {
    border:2px solid;
    color: #000;
    }
    
    .box:hover {
    color:purple;
    }
    

    See this demo here.

    0 讨论(0)
  • 2021-01-17 10:57

    Use the :hover psuedo selector:

    .box:hover {
       border-color: purple;
    }
    
    0 讨论(0)
  • 2021-01-17 11:02

    Very easy, just apply the selector :hover

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

    JSFiddle Here for you

    0 讨论(0)
提交回复
热议问题