Media queries have no influence over specificity. The normal rules of the cascade apply.
Both your rulesets have the same selector (.topnav
), so they are equally specific. The means that rules are applied in order.
First top
is set to 50%;
, then the second rule sets it to top: 0%;
.
Change the order of your rules.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…