0

Does anyone know how to implement the navigation hover effect displayed on this web page into my HTML/CSS document? The aforementioned page is using a WordPress theme, but I would like to add that green effect to my generic web page and be able to change the color as well.

P.S. I have never used Javascript before. (Be nice.)

1
  • It can be done by css3 transition. No need to write javascript. Commented Feb 3, 2016 at 4:38

2 Answers 2

2

Try This:

CSS

ul li{
 list-style:none;
}
ul li a{
transition:all 0.2s ease-out;
padding:5px;
border-radius:5px
}

ul li a:hover{
  background-color:#&dcc0e;
}

HTML:

<ul>
<li>
   <a>Hello</a>
</li>
</ul>
Sign up to request clarification or add additional context in comments.

Comments

0

This does not need any js. You can create the effect using css transition like this.

div{
                width: auto;
                float: left;
            }
            a{
                color: red;
                text-decoration: none;
                padding: 5px 20px;
                float: left;
                position: relative;
            }
            a:hover{
                color:#FFF;
            }
            a:after{
                content: '';
                background: red;
                position: absolute;
                top: 50%;
                right: 5%;
                bottom: 50%;
                left: 5%;
                border-radius: 3px;
                transition: all .1s;
                z-index: -1;
            }
            a:hover:after{
                top: 0;
                right: 0;
                bottom: 0;
                left: 0;
            }
<div><a href="javaScript:void(0);">menu</a></div>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.