<div class="flexbox">
<div class="search">
<h1>Search this site</h1>
<h3>Click on search icon, then type your keyword.</h3>
<div>
<input type="text" placeholder="Search . . ." required>
</div>
</div>
</div>
@import url("https://fonts.googleapis.com/css?family=Roboto:400,400i,700");
* {
font-family: Roboto, sans-serif;
padding: 0;
margin: 0;
}
html, body {
width: 100%;
height: 100%;
}
.flexbox {
background: linear-gradient(155deg, #55c7ed, #2bb3e0, #3bc1ed);
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.search {
margin: 20px;
}
.search > h3 {
font-weight: normal;
}
.search > h1,
.search > h3 {
color: white;
margin-bottom: 15px;
text-shadow: 0 1px #0091c2;
}
.search > div {
display: inline-block;
position: relative;
filter: drop-shadow(0 1px #0091c2);
}
.search > div:after {
content: "";
background: white;
width: 4px;
height: 20px;
position: absolute;
top: 40px;
right: 2px;
transform: rotate(135deg);
}
.search > div > input {
color: white;
font-size: 16px;
background: transparent;
width: 25px;
height: 25px;
padding: 10px;
border: solid 3px white;
outline: none;
border-radius: 35px;
transition: width 0.5s;
}
.search > div > input::placeholder {
color: #efefef;
opacity: 0;
transition: opacity 150ms ease-out;
}
.search > div > input:focus::placeholder {
opacity: 1;
}
.search > div > input:focus,
.search > div > input:not(:placeholder-shown) {
width: 250px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.