Skip to content

Instantly share code, notes, and snippets.

@johnbocook
Created January 10, 2023 23:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnbocook/015a6d096e29ca3e60252c0c3ad67687 to your computer and use it in GitHub Desktop.
Save johnbocook/015a6d096e29ca3e60252c0c3ad67687 to your computer and use it in GitHub Desktop.
/* You can use @media or link to a seperate print stylesheet
<link rel="stylesheet" href="global.css">
<link rel="stylesheet" href="print.css" media="print">
<link rel="stylesheet" href="specific.css" media="type and (feature)">
<link rel="stylesheet" href="landscape.css" media="(orientation: landscape)">
<link rel="stylesheet" href="portrait.css" media="(orientation: portrait)">
*/
@media print {
body {
background-color: transparent;
}
}
@media type and (feature) {
}
@media (orientation: landscape) {
// Styles for landscape mode.
}
@media (orientation: portrait) {
// Styles for portrait mode.
}
@media (min-width: 400px) {
// Styles for viewports wider than 400 pixels.
}
@media (max-width: 400px) {
// Styles for viewports narrower than 400 pixels.
}
@media (min-width: 25em) {
// You can use any css length units.
}
@media (min-width: 50em) and (max-width: 60em) {
// Styles for viewports wider than 50em and narrower than 60em.
}
/* This example: A breakpoint at 50em to make the interface more legible.
Using the column-count property, he text is divided into two columns from that point on. */
@media (min-width: 50em) {
article {
column-count: 2;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment