adc

clicks

Button Background Sliding Effect - Button Animation Effect | HTML & CSS Source Code

 CSS3 Animated Button A nice looking 3d button Copy and Paste the code ... Try to do it without peeking at the source for the CodePen challenge, but if you ... Nov 15, 2017 · Button background sliding animation effect using HTML and CSS by Easy web Coding
 


HTML
Before we start writing code first, we need to create a primary structure of the HTML document, so that the browser can understand and start working. The basic HTML structure looks like the following.
After writing the primary structure of the HTML document, you will also write the tags and content you need. After that, you can see the output in your browser. We know that HTML Sudu Mae is used for exposing content in a basic format. To complete our content we need to use CSS, which is an HTML insert and it creates an engaging user interface.


<!DOCTYPE html>
<html>
<head>
            <title>Button Background</title>
            <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
            <div class="wrapper">
                        <div class="btn1"><p>Hover Over Me</p></div>
                        <div class="btn2"><p>Hover Over Me</p></div>
                        <div class="btn3"><p>Hover Over Me</p></div>
                        <div class="btn4"><p>Hover Over Me</p></div>
            </div>
</body>
</html>
CSS 
Now, we have time to improve the HTML content, for that, we need to add CSS to the HTML file. CSS can be added to HTML documents in a total of three ways, here we are using outside CSS design using CSS will arrive here after typing and see the output in your browser.

*{
            margin: 0;
            padding: 0;
}
body{
            background: #465442;
            font-family: arial;
}
 
.wrapper{
            top: 50%;
            left: 50%;
            position: absolute;
            transform: translate(-50%, -50%);
}
 
.btn1, .btn2, .btn3, .btn4{
            width: 220px;
            height: 45px;
            line-height: 45px;
            position: relative;
            cursor: pointer;
            border:4px solid white;
            margin: 30px 0;
            overflow: hidden;
}
 p {
            position: relative;
            z-index: 1;
            color: white;
            font-weight: 900%;
            text-transform: uppercase;
            text-align: center;
            transition: all 0.5s ease;
}
.btn1:before, .btn2:before, .btn3:before, .btn4:before {
 content: "";
  position: absolute;
  top: 0;
  left: 0;
  background: black;
  width: 100%;
  height: 100%;
  transition: all 0.5s ease;
}
.btn1:before{top:-50px;}
.btn2:before{left:-225px;}
.btn3:before{left:225px;}
.btn4:before{top:50px;}
 
 
p:hover{
            color:#00bfb6;
            transition: all 0.5s ease;
}
 
.btn1:hover:before, .btn4:hover:before{
            top: 0px;
            transition: all 0.5s ease;
}
 
.btn2:hover:before, .btn3:hover:before{
            left: 0px;
            transition: all 0.5s ease;
}







Button Background Sliding Effect - Button Animation Effect | HTML & CSS Source Code Button Background Sliding Effect - Button Animation Effect | HTML & CSS Source Code Reviewed by easycoding on August 29, 2020 Rating: 5

No comments:

Powered by Blogger.