Skip to content

Instantly share code, notes, and snippets.

@KBPsystem777
Last active May 24, 2020 06:31
Show Gist options
  • Save KBPsystem777/e657c112015d2b1e76e8c0beb99991a6 to your computer and use it in GitHub Desktop.
Save KBPsystem777/e657c112015d2b1e76e8c0beb99991a6 to your computer and use it in GitHub Desktop.
Responsive Website using CSS only
/* Responsive Images */
img {
max-width: 100%;
}
/* Tablet Landscape */
@media screen and (max-width: 1060px) {
#primary {
width: 67%;
}
#secondary {
width: 30%;
margin-left: 3%;
}
}
/* Tabled Portrait */
@media screen and (max-width: 768px) {
#primary {
width: 100%;
}
#secondary {
width: 100%;
margin: 0;
border: none;
}
@media (min-device-width: 600px) {
img[data-src-600px] {
content: attr(data-src-600px, url);
}
}
@media (min-device-width: 800px) {
img[data-src-800px] {
content: attr(data-src-800px, url);
}
}
}
/* Typography */
@media (min-width: 640px) {
body {
font-size: 1rem;
}
}
@media (min-width: 960px) {
body {
font-size: 1.2rem;
}
}
@media (min-width: 1100px) {
body {
font-size: 1.5rem;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment