Home > database >  how to fix the Error at-rule or selector expected
how to fix the Error at-rule or selector expected

Time:08-08

I'm getting an error where it says "at-rule or selector expected" I've tried putting a semi-colon at the end but it wont work. Please do recommend some suggestions for me as I don't know what to do. I have tried checking my code over and over for any CSS errors but there doesn't seem to be any, so I really don't know what's wrong here.

*{
  padding-left:10px;
  padding-right:10px;
  margin:0;

}

.navbar-brand img{
  width:150px;
  margin-top: -5%;
}

.navbar-brand{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  top:10px;
  font-size:7.25rem  !important;

}

#navBarSearchForm
{
  width: 250px;
  font: size 14rem;
}

.banner{
  padding-left: 60px;
  padding-right:60px;
}


.navbar li ul {
  background: lightgrey;
  visibility: visible;
  opacity: 0;
  min-width: 5rem;
  position: absolute;
  transition: all 0.5s ease;
  display: none;
}

/*category hover*/
.navbar  li:hover>ul,
ul li:focus-within>ul,
ul li ul:hover,
ul li ul:focus {
  visibility: visible;
  opacity: 1;
  display: inline;
}


  .search{
    position: relative;
    box-shadow: 0 0 40px rgba(51, 51, 51, .1);

    }
    .search input{

      height: 40px;
      text-indent: 25px;
      border: 2px solid #d6d4d4;
     }

     .search input:focus{
      box-shadow: none;
      border: 2px solid blue;
     }

     .search .fa-search{
      position: absolute;
      top: 15px;
      left: 16px;
     }

     .search button{
      position:absolute;
      top: 3px;
      right: 5px;
      height: 35px;
      width: 60px;
      background: blue;

     }

     /*category navbar*/
table, tr , td  {
  border: none;
  border-collapse: collapse;
  width: 350px;
  padding:2.5px;
  background-color: bisque;

}
tr a:hover{
 background-color:rgb(149, 240, 149);

}


@media(max-width:786px)
{
.search
{display:none;}

  .navbar-brand{
    width: 7rem  !important;
  }

 .nav-item {
  display:inline-flex;
}
  .navbar-brand img{
    display:none;
}

}


.footer {
  position:fixed;
  padding: 10px 10px 0px 0px;
  width: 100%;
  bottom: 0;
  text-align: center;
  background-color: black;
  color: white;
  z-index: 1;

}



 @media (max-width: 600px) {
    
    
      .footer {width: 100%;  text-align: center; } }
    
    }//error happens here

CodePudding user response:

You have an additional } Replace this :

 @media (max-width: 600px) {
    
    
      .footer {width: 100%;  text-align: center; } }
    
    }//error happens here

with this :

 @media (max-width: 600px) {
    
    
      .footer {width: 100%;  text-align: center; } 
    
 }

CodePudding user response:

I checked your CSS and found one additional semi-column which isn't required, as well as the invalid properties 'font: size 14rem;' which should be 'font-size: 14rem;' like this.

Please check the updated CSS and let me know if there are any issues.

*{
    padding-left: 10px;
    padding-right: 10px;
    margin: 0;
}
.navbar-brand img{
    width: 150px;
    margin-top: -5%;
}
.navbar-brand{
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 10px;
    font-size: 7.25rem !important;
}
#navBarSearchForm {
    width: 250px;
    font-size: 14rem;
}
.banner {
    padding-left: 60px;
    padding-right: 60px;
}
.navbar li ul {
    background: lightgrey;
    visibility: visible;
    opacity: 0;
    min-width: 5rem;
    position: absolute;
    transition: all .5s ease;
    display: none;
}

/*category hover*/

.navbar li:hover > ul,
ul li:focus-within > ul,
ul li ul:hover,
ul li ul:focus {
    visibility: visible;
    opacity: 1;
    display: inline;
}
.search{
    position: relative;
    box-shadow: 0 0 40px rgba(51, 51, 51, .1);
}
.search input{
    height: 40px;
    text-indent: 25px;
    border: 2px solid #d6d4d4;
}
.search input:focus{
    box-shadow: none;
    border: 2px solid blue;
}
.search .fa-search{
    position: absolute;
    top: 15px;
    left: 16px;
}
.search button{
    position: absolute;
    top: 3px;
    right: 5px;
    height: 35px;
    width: 60px;
    background: blue;
}

/*category navbar*/

table,
tr,
td {
    border: none;
    border-collapse: collapse;
    width: 350px;
    padding: 2.5px;
    background-color: bisque;
}
tr a:hover {
    background-color: rgb(149, 240, 149);
}
.footer {
    position: fixed;
    padding: 10px 10px 0 0;
    width: 100%;
    bottom: 0;
    text-align: center;
    background-color: black;
    color: #fff;
    z-index: 1;
}

@media(max-width: 786px){
    .search {
        display:none;
    }
    .navbar-brand{
        width: 7rem !important;
    }
    .nav-item {
        display: inline-flex;
    }
    .navbar-brand img{
        display: none;
    }
}

 @media (max-width: 600px) {
    .footer {
        width: 100%;
        text-align: center;
    }
}

Note: Indentation should be proper, and unnecessarily high spacing and white space should be avoid.

  • Related