Видео и код!
Видео и код!
...Читать далее
Код:
HTML:
<!doctype html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/js/all.min.js"></script>
<link rel="stylesheet" href="style.css">
<title>Search That Opens</title>
</head>
<body>
<div class="search">
<input type="text" class="searchText" placeholder="Search...">
<a class="searchBtn">
<i class="fas fa-search"></i>
</a>
</div>
</body>
</html>
CSS:
* {
margin: 0;
padding: 0;
}
body {
background: linear-gradient(45deg, #ffa500, #ff2400);
display: flex;
min-height: 100vh;
justify-content: center;
align-items: center;
}
.search {
display: flex;
background: #2f3640;
height: 40px;
border-radius: 40px;
padding: 10px;
}
.searchBtn {
width: 40px;
height: 40px;
border-radius: 50%;
background: #2f3640;
display: flex;
justify-content: center;
align-items: center;
transition: 0.4s;
color: white;
cursor: pointer;
}
.searchBtn > i {
font-size: 30px;
}
.search:hover > .searchText {
width: 240px;
padding: 0 6px;
}
.searchText {
border: none;
background: none;
outline: none;
padding: 0;
color: #ffffff;
font-size: 16px;
transition: 0.4s;
line-height: 40px;
width: 0;
font-weight: bold;
}
.search:hover > .searchBtn {
background: linear-gradient(45deg, #ff2400, #ffa500);
color: #ffffff;
}
.search:hover > .searchBtn:hover {
background: linear-gradient(45deg, #ffa500, #ff2400);
}
Подписывайтесь, на мой YouTube-канал