Skip to content

CSS Basic Select Box


HTML CODE:

<!DOCTYPE html>
<html>
<head>
    <title>page</title>
    <link rel="stylesheet" type="text/css" href="select1.css">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css">
</head>
<body>

    <div class="box">
        <i class="fas fa-arrow-alt-circle-down"></i>
        <select>
            <option>Option 1</option>
            <option>Option 2</option>
            <option>Option 3</option>
            <option>Option 4</option>
            <option>Option 5</option>
        </select>
    </div>

</body>
</html>

CSS CODE:

body{
    margin: 0;
    padding:0;
    background:#004882;
}
.box{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
}
.box select{
    background:#0563af;
    color: #fff;
    padding:10px;
    width: 250px;
    height: 50px;
    border:none;
    font-size: 20px;
    box-shadow: 0 5px 25px rgba(0,0,0,.5);
    -webkit-appearance:button;
    outline:none;
}
.box:before{
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 50px;
    background: #007ce0;
    pointer-events:none;
}
.box:hover:before{
    background: #0472ca;
}
i{
    position: absolute;
    top: 15%;
    left: 83%;
    font-size: 35px;
    color:#fff;
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: