Search
 
SCRIPT & CODE EXAMPLE
 

CSS

sliding button css

  <div class="main">
            <div class="group">
                <a href="#" class="two">
                    <span>I AM COOL TOO</span>
                    <div class="bg"></div>
                </button>
                <a href="#" class="one">I AM COOL</a>
            </div>
        </div>

html {
    font-family: 'Inconsolata', monospace;
    font-weight: 700;
    font-size: 20px;
}
html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    background: #2c3e50;
}
.main {
    width: 100%;
    height: 100%;
    background-color: #2c3e50;
}
.group {
    width: 340px;
    height: 40px;
    padding: 10px 40px;
    line-height: 40px;
    position: relative;
    z-index: 1;
    margin-left: auto;
    margin-right: auto;
    margin-top: 100px;
    
}
.one {
    float: left;
    line-height: 40px;
    color: white;
    text-decoration: none;
    transition: 1.0s;
}
.two {
    float: right;
    text-decoration: none;
    line-height: 40px;
    color: #a6afbf;
}
.bg {
    background-color: #e67e22;
    height: 60px;
    width: 190px;
    position: absolute;
    top: 0;
    margin-left: -260px;
    z-index: -1;
    transition: 1.0s;
    border-radius: 5px;
    
}

span:hover + .bg {
    width: 200px;
    margin-left: -40px;
    background: #27ae60;
}

.two > span:hover {
    color: white;
}

.two:hover ~ .one {
    color:#fff;
}
span {
    padding: 10px 0;
    transition: 1.0s;
}
Comment

PREVIOUS NEXT
Code Example
Css :: how to code color css property 
Css :: webkit-scrollbar-button css 
Css :: values play state animation css 
Css :: andy bells css reset 
Css :: Viewport is 480 pixels or smaller css 
Css :: restrict css to apply on div 
Css :: css how to stop screen from left and right 
Css :: position absolute above everything 
Css :: sass css variables root 
Css :: adding diffent style in firefox css 
Css :: graident colors 
Css :: datepicker disable future date odoo 
Css :: 2 scrollbars 
Css :: how mto change the label font style in css 
Css :: cards design html css 
Css :: my customized css export chrome dev 
Css :: what happens when the width is 0 and there is a border and box-sizing is set to border-box? 
Css :: how to set scss variables 
Css :: center 
Css :: css background templates 
Css :: button hover animation css codepen 
Css :: css class inheritance 
Css :: css bottom:0 isnt the bottom of the page 
Css :: add a class to header 
Css :: center div with variable height 
Css :: background shorthand code 
Css :: css before cant change the size 
Css :: swipe animation css 
Css :: float pb 
Css :: Curve Text Around a Floated Image 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =