top of page
Writer's pictureWeb Coding

How to underline links when the user hovers their mouse over

Today I will be teaching you how to underline a link when the user hovers their mouse over



HTML

<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="UTF-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <title>Document</title>
 <link rel="stylesheet" href="style.css">
</head>
<body>
 <a href="Link to a website">Click Me</a>
</body>
</html>

CSS

body{
 min-height100vh;
 displayflex;
 justify-contentcenter;
 align-itemscenter;
}

a{
 text-decorationnone;
 colorblack;
 font-size104px;
}

a:hover{
 cursorpointer;
 text-decorationunderline;
}

If you found this blog post helpful don’t forget to check out my other projects and if you want more content follow me on


YouTube: https://www.youtube.com/channel/UC2nxqB2usQIS2c8zwVZKWEQ

Instagram: https://www.instagram.com/coding_for_the_web/

Twitter: https://twitter.com/LearnWebCoding

6 views

Comments


bottom of page