All mobile screens in portrait:
In CSS:
@media only screen and (max-device-aspect-ratio: 1) and (orientation: portrait) {
aside{ display: none;}
}
Small mobile screens in portrait with explicitly set viewport width:
Declare this scaling mode in HTML <head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
In CSS:
@media only screen and (max-width: 479px) and (max-device-aspect-ratio: 1) and (orientation: portrait) {
aside{ display: none;}
}
All mobile screens in portrait with default viewport width (980px):
Note: It has become standard practice in modern web design to define your viewport width instead of leaving it at the default 980px. It is integral to Responsive Design. I strongly suggest taking some time to learn about it.
In CSS:
@media only screen and (width: 980px) and (max-device-aspect-ratio: 1) and (orientation: portrait) {
aside{ display: none;}
}