pld
pld
KPCKevin Powell - Community
Created by pld on 9/13/2023 in #front-end
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?
3 replies