Merhaba.Css de before efektli bir buton yapmaya calisdim.ama beforenin contenti butonun uzerine cikti ve buton altda kaldi.bu sorunu z-index ile cozmeye calisdim.ama anlamadigim bir sekilde calismadi.Kodlar:
<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style type="text/css">
body{
margin: 0px;
padding: 0px;
z-index: 0;
}
button{
position: absolute;
padding: 20px;
width: 250px;
background-color: rgb(29, 25, 25);
border: 3px solid royalblue;
transition: all .8s ease-in-out;
z-index: 1;
}
button::before{
content: "";
position: absolute;
left: 0px;
top: 0px;
height: 100%;
width: 0%;
background-color: royalblue;
transition: all .8s ease-in-out;
z-index: 2;
}
button:hover::before{
content: "";
width: 100%;
z-index: 2;
}
span{
z-index: 3;
color: royalblue;
transition: all .8s ease-in-out;
letter-spacing: 5px;
}
button:hover span{
color:rgb(29, 25, 25);
}
</style>
</head>
<body>
<button><span>BUTON</span></button>
</body>
</html>
Yardimci olursaniz sevinirim.