ButtonsTutorials

how to create a Fancy Buttons (pure CSS)

how to create a Fancy Buttons (pure CSS)

how to create a Fancy Buttons (pure CSS)

Before We Start

Every developers need, clean and modern elements to develop their websites, It contain pictures and a user interface element within a website. The most important one and the first section that the user sees when he/she enters a website. how to create a Fancy Buttons (pure CSS)

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

how to create a Fancy Buttons (pure CSS)

We are here to solve your problem. In this article we discuss how to create this 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.

<html>
<body>

  <div id="wrapper">

    <a class="fancygrow" href="#"><i class="fa fa-caret-square-o-up famargin" aria-hidden="true"></i>GROW ME</a>

    <a class="fancyshrink" href="#"><i class="fa fa-caret-square-o-down famargin" aria-hidden="true"></i>SHRINK ME</a>

  </div>

</body>
</html>

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://fonts.googleapis.com/css?family=Dosis:300" rel="stylesheet">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Alegreya+Sans:900" rel="stylesheet">
</head>

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

<style>
html {
  background-image: url("http://cakie.de/onewebmedia/12771821_429625677248251_7456166847252003761_o.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#wrapper {
  width: 80%;
  margin: 0 auto;
}

.fancygrow {
  font-family: "Alegreya Sans", sans-serif;
  font-size: 30px;
  width: 100%;
  /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#002c44+0,0083c9+100 */
  background: #002c44; /* Old browsers */
  background: -moz-linear-gradient(
    45deg,
    #002c44 0%,
    #0083c9 100%
  ); /* FF3.6-15 */
  background: -webkit-linear-gradient(
    45deg,
    #002c44 0%,
    #0083c9 100%
  ); /* Chrome10-25,Safari5.1-6 */
  background: linear-gradient(
    45deg,
    #002c44 0%,
    #0083c9 100%
  ); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#002c44', endColorstr='#0083c9',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
  display: block;
  text-align: center;
  max-width: 400px;
  height: 50px;
  line-height: 50px;
  margin: 25px auto;
  color: white;
  text-decoration: none;
  border-radius: 20px 20px 20px 20px;
  -moz-border-radius: 20px 20px 20px 20px;
  -webkit-border-radius: 20px 20px 20px 20px;
  border: 0px solid #000000;
  -webkit-transition: all 1s ease;
  -moz-transition: all 1s ease;
  -o-transition: all 1s ease;
  transition: all 1s ease;
}

.fancygrow:hover {
  -webkit-box-shadow: 0px 14px 23px -10px rgba(0, 44, 68, 0.56);
  -moz-box-shadow: 0px 14px 23px -10px rgba(0, 44, 68, 0.56);
  box-shadow: 0px 14px 23px -10px rgba(0, 44, 68, 0.56);

  transform: scale(1.05, 1.05);
  -webkit-transform: scale(1.05, 1.05);
  -moz-transform: scale(1.05, 1.05);
  -o-transform: scale(1.05, 1.05);
  -ms-transform: scale(1.05, 1.05);
}

.fancyshrink {
  font-family: "Dosis", sans-serif;
  font-size: 30px;
  width: 100%;
  background: rgba(241, 231, 103, 1);
  background: -moz-linear-gradient(
    -45deg,
    rgba(241, 231, 103, 1) 0%,
    rgba(252, 70, 216, 1) 100%
  );
  background: -webkit-gradient(
    left top,
    right bottom,
    color-stop(0%, rgba(241, 231, 103, 1)),
    color-stop(100%, rgba(252, 70, 216, 1))
  );
  background: -webkit-linear-gradient(
    -45deg,
    rgba(241, 231, 103, 1) 0%,
    rgba(252, 70, 216, 1) 100%
  );
  background: -o-linear-gradient(
    -45deg,
    rgba(241, 231, 103, 1) 0%,
    rgba(252, 70, 216, 1) 100%
  );
  background: -ms-linear-gradient(
    -45deg,
    rgba(241, 231, 103, 1) 0%,
    rgba(252, 70, 216, 1) 100%
  );
  background: linear-gradient(
    135deg,
    rgba(241, 231, 103, 1) 0%,
    rgba(252, 70, 216, 1) 100%
  );
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f1e767', endColorstr='#fc46d8', GradientType=1 );
  display: block;
  text-align: center;
  max-width: 400px;
  height: 50px;
  line-height: 50px;
  margin: 25px auto;
  color: white;
  text-decoration: none;
  border-radius: 20px 20px 20px 20px;
  -moz-border-radius: 20px 20px 20px 20px;
  -webkit-border-radius: 20px 20px 20px 20px;
  border: 0px solid #000000;
  -webkit-transition: all 1s ease;
  -moz-transition: all 1s ease;
  -o-transition: all 1s ease;
  transition: all 1s ease;
}

.fancyshrink:hover {
  -webkit-box-shadow: 0px 14px 23px -10px rgba(0, 44, 68, 0.56);
  -moz-box-shadow: 0px 14px 23px -10px rgba(0, 44, 68, 0.56);
  box-shadow: 0px 14px 23px -10px rgba(0, 44, 68, 0.56);

  transform: scale(0.95, 0.95);
  -webkit-transform: scale(0.95, 0.95);
  -moz-transform: scale(0.95, 0.95);
  -o-transform: scale(0.95, 0.95);
  -ms-transform: scale(0.95, 0.95);
}

.famargin {
  margin: 0 10px;
}

</style>

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

how to create a Fancy Buttons (pure CSS)

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