A
A
Alex Sokol2015-03-06 13:54:31
css
Alex Sokol, 2015-03-06 13:54:31

Why is the style not being applied in Media?

1. Set the style for the page:

.site-cover {
  background: url('../images/pattern.jpg') repeat;
  margin-top: 170px;
  margin-bottom: 60px;
  box-shadow: 0px 0px 5px #999;
}

2. Need to cancel for screens 960px and smaller media screen and (max-width: 960px) some styles:
.site-cover {
  background: none;
  box-shadow: none;
}

Почему-то не срабатывает. Если ставлю display: none; - то срабатывает, однако этот стиль не нужен.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Mokhov, 2015-03-06
@Sokol_ua

I assume that the second code with media is specified in the markup before the first, so it turns out that the first overrides the second

B
Bob Hope, 2015-03-06
@Bobert88

Perhaps Andrey is right, or there is some other error in the markup, you need to look, because this simple example with your styles works:
codepen.io/anon/pen/KwxdMy

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question