css nesting

@media only screen and (min-width: 1440px) {
#menu_div {
display: none;
}
}

@media screen and (max-width: 1440px) {
#menu_div {
display: block;
height: 30px;
width: 30px;
margin-right: 10px;
margin-left: auto;
}
}
@media only screen and (min-width: 1440px) {
#menu_div {
display: none;
}
}

@media screen and (max-width: 1440px) {
#menu_div {
display: block;
height: 30px;
width: 30px;
margin-right: 10px;
margin-left: auto;
}
}
this work
#menu_div {
@media screen and (max-width: 1440px) {
display: block;
height: 30px;
width: 30px;
margin-right: 10px;
margin-left: auto;
}
@media screen and (min-width: 1440px) {
display: none;
}
}
#menu_div {
@media screen and (max-width: 1440px) {
display: block;
height: 30px;
width: 30px;
margin-right: 10px;
margin-left: auto;
}
@media screen and (min-width: 1440px) {
display: none;
}
}
this doesn't work. why? how to make media query nest in selector?
1 Reply
pld
pld10mo ago
I found out probably is browser problem. Brave working, librewolf doesn't
#menu_div {

height: 30px;
width: 30px;
& p {
color: white;
}
}
#menu_div {

height: 30px;
width: 30px;
& p {
color: white;
}
}