Answer the question
In order to leave comments, you need to log in
How does the browser handle these styles in this case?
There are styles
.title {
color: red;
height: 30px;
}
@media screen and (max-width: 1000px) {
.title {
display: none;
}
}
display: none
and not apply the other styles? .title {
color: red;
height: 30px;
}
@media screen and (max-width: 1000px) {
.title {
height: 60px;
}
}
@media min-width?
Answer the question
In order to leave comments, you need to log in
Long answer:
https://developer.mozilla.org/en/docs/Web/Performa...
Short answer:
For each node, it will find the corresponding rules and apply the highest priority. In this case, from the media. But this wording "first one thing then the other" is meaningless. The file itself is read sequentially, not all lines at the same time.
The browser will first set the height to 30, and then 60, thereby causing two reflows?
That is, it would be much better to use media min-width as well?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question