ButtonsTutorials

Custom Radio Button | Youtube Like & Dislike

Custom Radio Button | Youtube Like & Dislike

Before We Start

Every developer needs clean and modern elements to develop their websites, It contains pictures and a user interface element within a website. The most important one and the first section that the user sees when the user enters a website. Custom Radio Button | Youtube Like & Dislike

So if you are a person who wishes to develop a website, you have to know how to create that properly.

Custom Radio Button | Youtube Like & Dislike

We are here to solve your problem. In this article we discuss how to create these elements. Before we start please read the below articles which easier you to understand the process, if you are new to development.

Step 1 – Add HTML

It’s too easy and simple. Just copy and paste below code in your HTML editor between <body> </body> tag.

<div class="wrapper">
    <div class="radio_group">
      <input type="radio" name="like">
      <label for="like">
        <i class="fas fa-thumbs-up"></i>
      </label>
    </div>
    <div class="radio_group">
      <input type="radio" name="like">
      <label for="like">
        <i class="fas fa-thumbs-down"></i>
      </label>
    </div>
  </div>

<div class="youtubeBtn">
  <a target="_blank" href="https://www.youtube.com/channel/UCHYzcf5iDt5iXhncuI7C_AA">
      <span>Watch on YouTube</span>
  <i class="fab fa-youtube"></i>
    </a>

</div> 

Step 2 – Add CSS

We use some external CSS link to this code. No need to worry about this, copy and paste below code between <style></style> tag.

<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
</head>

Copy and paste below code in your HTML editor between <style></style> tag.

<style>
*{
  box-sizing: border-box;
  transition: all .1s ease-in-out;
}
body{
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgb(9,22,88);
background: linear-gradient(0deg, rgba(9,22,88,1) 0%, rgba(190,16,52,1) 100%);
}
.wrapper{
  width: 180px;
  height: 80px;
  background-color: #fff;
  padding: 10px;
  border-radius: 4px;
  box-shadow: 0px 0px 5px rgba(0,0,0,.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.radio_group{
  width: 50px;
  height: 50px;
  margin: 5px;
  position: relative;
  text-align: center;
  line-height: 50px;
  font-size: 40px;
}
.radio_group input[type="radio"]{
  opacity: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0px;
  top: 0px;
  margin: 0;
  padding: 0;
  z-index: 1;
  cursor: pointer;
}
.radio_group input[type="radio"] + label{
  color: #95a5a6;
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  transform: scale(.8);
}
.radio_group input[type="radio"]:checked + label{
  color:#3498db;
  transform: scale(1.1);
}


/*  footer   */
footer {
    background-color: #222;
    color: #fff;
    font-size: 14px;
    bottom: 0;
    position: fixed;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 999;
}

footer p {
    margin: 10px 0;
    font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida  Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
}
footer .fa-heart{
    color: red;
}
footer .fa-dev{
    color: #fff;
}
footer .fa-twitter-square{
  color:#1da0f1;
}
footer .fa-instagram{
  color: #f0007c;
}
fotter .fa-linkedin{
  color:#0073b1;
}
footer .fa-codepen{
  color:#fff
}
footer a {
    color: #3c97bf;
    text-decoration: none;
  margin-right:5px;
}
.youtubeBtn{
    position: fixed;
    left: 50%;
  transform:translatex(-50%);
    bottom: 45px;
    cursor: pointer;
    transition: all .3s;
    vertical-align: middle;
    text-align: center;
    display: inline-block;
}
.youtubeBtn i{
   font-size:20px;
  float:left;
}
.youtubeBtn a{
    color:#ff0000;
    animation: youtubeAnim 1000ms linear infinite;
  float:right;
}
.youtubeBtn a:hover{
  color:#c9110f;
  transition:all .3s ease-in-out;
  text-shadow: none;
}
.youtubeBtn i:active{
  transform:scale(.9);
  transition:all .3s ease-in-out;
}
.youtubeBtn span{
    font-family: 'Lato';
    font-weight: normal;
    color: #FFF;
    display: block;
    font-size: 12px;
    float: right;
    line-height: 20px;
    padding-left: 5px;
  
}

@keyframes youtubeAnim{
  0%,100%{
    color:#FFFFFF;
  }
  50%{
    color:#ff0000;
  }
}
/* footer  */
</style>

At the end we will have something like this. You can change fonts, colors, backgrounds and all things that you want. Enjoy it.

Your Output

Custom Radio Button | Youtube Like & Dislike

Your Output

Custom Radio Button | Youtube Like & Dislike

Video Tutorial

Please watch this video to better understand this tutorial and don’t forget to subscribe to our channel.


Help others to find out about this article on Social Media sites. If you have any doubt or any problem, don’t hesitate to contact us. Thereafter we will be able to help you and also make sure you bookmark our site on your browser.

Related Articles

Leave a Reply

Your email address will not be published.

Back to top button