user2044626
user2044626

Reputation: 281

CSS media screen remove whole class

I have a class called .nav ul li ul working before using @media screen, When I work on media screen I want to disable this class (Don't want css to read it anymore). Is there anyway to do this? Example

.nav ul li ul {
  padding: 0;
  position: relative;
  top: 40px;
  left: -30px;
  width: 200px;
}

@media screen and (max-width: 600px) {

.nav ul li ul {
  Do not do anything, Just ignore the original class
}

}

Please note that I still want to display this class But I don't want to give it any properties. Thanks

Upvotes: 1

Views: 528

Answers (2)

Xtian
Xtian

Reputation: 498

What you can do is you can either recopy the same properties:

@media screen and (max-width: 600px) {

.nav ul li ul {
  padding: 0;
  position: relative;
  top: 40px;
  left: -30px;
  width: 200px;
}

or just simply don't write that part. It actually worked on the times when I try it.

Upvotes: 1

Wolfie
Wolfie

Reputation: 1381

@media screen and (max-width: 600px) {
    .nav ul li ul {
      padding: 0;
      position: relative;
      top: 0px;
      left: 0px;
      width: 0px;
    }
}

This should reset all the properties previously set.

Reset/remove CSS styles for element only

That link is to a question that has many default property values for css, as there is currently no built in way to reset it to a default.

Upvotes: 2

Related Questions