JSFiddle - React, Tailwind, and code Playground
HTML
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Navigation Menu</title>
<link
href="https://fonts.googleapis.com/css2?family=Marcellus&display=swap"
rel="stylesheet"
/>
</head>
<body>
<nav class="menu">
<ul>
<li>
<a href="#" title="About">
<span>Son Histoire</span>
</a>
</li>
<li>
<a href="#" title="my page">
<span>Ses Bienfaits</span>
</a>
</li>
<li>
<a href="#" title="my page">
<span>Pour Qui ?</span>
</a>
</li>
<li>
<a href="#" title="my page">
<span>Édition de nos tableaux</span>
</a>
</li>
</ul>
</nav>
</body>
</html>
CSS
body {
background-color: #000;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
font-family: 'Marcellus', serif;
}
/* --- CSS Extracted from Image --- */
.menu ul {
margin: 0;
padding-left: 0;
list-style: none;
display: inline;
font-size: 30px;
}
.menu ul li a {
display: block;
padding: 1rem;
text-decoration: none;
color: white;
}
.menu ul li a span {
position: relative;
padding-bottom: 0.7rem;
}
.menu ul li a span:after {
content: '';
position: absolute;
left: 0;
bottom: 0;
transform: translateX(-50%) scaleX(0);
width: 100%;
height: 2px;
background-color: white;
transition: transform 250ms;
}
.menu ul li a:hover span:after {
transform: translateX(0%) scaleX(1);
}