<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Efeito preenchimento </title>
</head>
<body>
<h1>#30diasdeCSS</h1>
</body>
</html>
HTML
格式化
支持Emmet,输入 p 后按 Tab键试试吧!
<head> ... </head>
<body>
</body>
CSS
格式化
body
{
margin: 0;
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
font-family: sans-serif;
}
h1
{
margin: 0;
padding: 0;
font-family: verdana;
font-size: 120px;
color: rgba(255, 99, 71, 0.336);
text-transform: uppercase;
position: relative;
}
h1::before
{
content: "#30diasdeCSS";
position: absolute;
top: 0%;
left: 0%;
color: tomato;
width: 0%;
overflow: hidden;
transition: all 0.6s;
}
h1:hover::before
{
width: 100%;
}
JS
格式化