Preview

Nội dung

HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Search 2</title>
    <link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css"/>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="search2">
        <input type="search" placeholder="Search ..."/>
        <button><i class="fas fa-search"></i></button>
      </div>
</body>
</html>

CSS

html {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    background-image: linear-gradient( to right, #1C7698, #9B1E6C);
    text-align: center;
}

input,
button {
    outline: none;
    border: 0;
    margin: 0;
    padding: 0;
    border-radius: 0;
    -webkit-appearance: none;
}

button {
    cursor: pointer;
}
  
.search2 {
    width: 100%;
    display: flex;
    margin-top: 35px;
}

.search2 button {
    padding: 15px;
    color: white;
    flex-shrink: 0;
    border-radius: 8px;
    background-color: #1C7698;
    margin-left: 15px;
}

.search2 button:focus{
    background-color: #DDB4CE;
    border-radius: 15px;
    transition: 0.4s;
}

.search2 input {
    width: 100%;
    padding: 15px;
    background-color: #fafafa;
    border-radius: 8px;
    -webkit-appearance: none;
    font-size: 14px;
    font-weight: 500;
}

.search2 input:focus{
    border: 3px solid #DDB4CE;
    transition: 0.2s ease;
}