@media print {
/* … */
}Using media queries / notebook
Using media queries
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
@media screen, print {
/* … */
}@media (hover: hover) {
/* … */
}@media print and (orientation: portrait) {
/* … */
}@media (max-width: 1250px) {
/* … */
}@media (width <= 1250px) {
/* … */
}
@media (1250px >= width) {
/* … */
}@media (min-width: 30em) and (max-width: 50em) {
/* … */
}
@media (30em <= width <= 50em) {
/* … */
}
@media (50em >= width >= 30em) {
/* … */
}@media (30em < width < 50em) {
/* … */
}
@media (50em > width > 30em) {
/* … */
}@media (color) {
/* … */
}@media (width >= 30em) and (orientation: landscape) {
/* … */
}@media screen and (width >= 30em) and (orientation: landscape) {
/* … */
}@media (height >= 680px), screen and (orientation: portrait) {
/* … */
}@media not print {
/* … */
}@media not screen and (color), print and (color) {
/* … */
}@media not ((width > 1000px) and (color)), print and (color) {
/* … */
}@media (not (width > 1000px)) and (color), print and (color) {
/* … */
}@media screen and not (hover) {
/* … */
}@media only screen and (color) {
/* … */
}@media (not (color)) or (hover) {
/* … */
}@media ((color) and (hover)) or (monochrome) {
/* … */
}
/* or */
@media (color) and (hover), (monochrome) {
/* … */
}