My CSS Transition line – "transition: all 0.3s ease;" is not working (on browser refresh)

My CSS transition/animation is not working. This is the line, "transition: all 0.3s ease;". I am a little new to CSS and am not sure what I am doing wrong. Posted below is my css and html for the nav menu section that is having this problem. On refresh of the browser, I should see the transition happening but not sure why it is not picking up.

Line/Transition used in ".nav-menu .close-nav-menu" and ".nav-menu ul li a" (CSS).

CSS Style:

    position: fixed;
    background-color: var(--bg-black-50);
    padding:0 15px;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    overflow-y: auto;

.nav-menu .close-nav-menu{
    height: 40px;
    width: 40px;
    display: block;
    font-size: 35px;
    line-height: 35px;
    border-radius: 35px;
    position: absolute;
    right: 15px;
    top: 15px;
    cursor: pointer;
    text-align: center;
    color: var(--text-black-600);
    transition: all 0.3s ease;
.nav-menu .close-nav-menu:after{
    border-radius: 50%;

    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;

.nav-menu ul{
    padding: 15px;

.nav-menu ul li {
    display: block;
    margin-bottom: 20px;
    text-align: center;
.nav-menu ul li:last child{
    margin-bottom: 0;

.nav-menu ul li a{
    display: inline-block;
    font-size: 28px;
    font-weight: 600;
    color: var(--text-black-700);
    padding: 5px 30px;
    text-transform: capitalize;
    border-radius: 30px;
    transition: all 0.3s ease;

.nav-menu ul li a:after{
    border-radius: 30px;

This is my CSS style sheet. and my HTML is,


<!-- navigation menu start -->  
<nav class="nav-menu">
  <div class="close-nav-menu outer-shadow hover-in-shadow">&times;</div>
  <div class="nav-menu-inner">
      <li><a href="#" class="inner-shadow active">home</a></li>
      <li><a href="#" class="outer-shadow hover-in-shadow">about</a></li>
      <li><a href="#" class="outer-shadow hover-in-shadow">services</a></li>
      <li><a href="#" class="outer-shadow hover-in-shadow">portfolio</a></li>
      <li><a href="#" class="outer-shadow hover-in-shadow">testimonial</a></li>
      <li><a href="#" class="outer-shadow hover-in-shadow">contact</a></li>
<!-- navigation menu end -->  

Read more here:

Content Attribution

This content was originally published by barathV at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: