Hello Readers, today in this article you will learn how to create Keyboard UI design with HTML and CSS. Earlier blog I have shared how can we can create Animated Skills Bar with HTML and CSS? Now I’m going to build Cool Keyboard UI design using HTML and CSS, for your website. Learning how to make a Cool Keyboard UI design is one of the best project you’ll complete as a web designer. The best Cool Keyboard UI design will use HTML and CSS to create the desired effect.
UI (User Interface)
Source Code
If you like this Keyboard UI Design, then feel free to use it in your project. Copy the code by clicking on Copy button provided below. First, you have to create two files. One of them is HTML, and the other is CSS. after creating the files, paste the code provided below.
HTML CODE:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>UI keyboard | By Code Info</title>
<link rel="stylesheet" href="style.css">
<!-- Font Awesome Cdn Link -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" />
</head>
<body>
<div class="keyboard">
<div class="row one">
<button class="oneBtn"><i class="fa-solid fa-arrow-right-arrow-left"></i></button>
<button>Q</button>
<button>W</button>
<button>E</button>
<button>R</button>
<button>T</button>
<button>Y</button>
<button>U</button>
<button>I</button>
<button>O</button>
<!-- <button>P</button> -->
<button class="oneBtn"><i class="fa-solid fa-delete-left"></i></button>
</div>
<div class="row two">
<button class="twoBtn">Caps Lock</button>
<button>A</button>
<button>S</button>
<button>D</button>
<button>F</button>
<button>G</button>
<button>H</button>
<button>J</button>
<button>K</button>
<button>L</button>
<button>|</button>
</div>
<div class="row three">
<button class="threeBtn">Shift</button>
<button>Z</button>
<button>X</button>
<button>C</button>
<button>V</button>
<button>B</button>
<button>N</button>
<button>M</button>
<button>M</button>
<button class="threeBtn">Enter</button>
</div>
<div class="row four">
<button class="fourBtn">ctrl</button>
<button>fn</button>
<button><i class="fa-solid fa-face-grin"></i></button>
<button><i class="fa-brands fa-windows"></i></button>
<button class="space">Space</button>
<button>alt</button>
<button><i class="fa-solid fa-face-grin-hearts"></i></button>
<button><i class="fa-solid fa-print"></i></button>
<button class="fourBtn">ctrl</button>
</div>
</div>
</body>
</html>
Second, create a CSS file with the name of style.css and paste the given codes in your CSS file. Remember, you have to create a file with .css extension.
CSS CODE:
/* import google fonts */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");
*{
margin: 0;
padding: 0;
border: none;
outline: none;
box-sizing: border-box;
font-family: "Poppins", sans-serif;
}
body{
background: #d8d8d8;
}
.keyboard{
margin: 100px auto;
width: 1100px;
}
button{
margin: 10px;
width: 70px;
height: 70px;
font-size: 16px;
background: #d8d8d8;
border-radius: 0.5rem;
cursor: pointer;
border: 1px solid #e8e8e8;
transition: all 0.3s;
box-shadow: 6px 6px 12px #afafaf, -6px -6px 12px #e0e0e0;
}
button:hover{
border: 1px solid #fff;
}
button:active{
box-shadow: 4px 4px 12px #c5c5c5, -4px -4px 12px #fff;
}
i{
font-size: 22px;
}
.oneBtn{
width: 100px;
}
.twoBtn{
width: 128px;
}
.threeBtn{
width: 146px;
}
.fourBtn{
width: 90px !important;
}
.space{
width: 335px !important;
}
.four button{
width: 60px;
}
I hope you liked this snippet. If so, please share the blog and follow us in our social media profiles and stay connected with this blog. Thank you for visiting.