Skip to content

Instantly share code, notes, and snippets.

@eliah-w
Created September 9, 2016 07:11
Show Gist options
  • Save eliah-w/3480ddd9337c3409221d39af2efc89f2 to your computer and use it in GitHub Desktop.
Save eliah-w/3480ddd9337c3409221d39af2efc89f2 to your computer and use it in GitHub Desktop.
CSS Locks
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>CSS Locks</title>
<style type="text/css">
#container {
width: 250px;
margin: 0 auto;
text-align: center;
}
p {
font-size: 1rem;
}
p:before {
content: "Smallest font size.";
}
@media (min-width: 320px) {
#container {
width: calc(250px + 20vw);
}
p {
font-size: calc(1rem + 2vw);
}
p:before {
content: "Resize your window!";
}
}
@media (min-width: 960px) {
#container {
width: 350px;
}
p {
font-size: 2.5rem;
}
p:before {
content: "BIGGEST font size";
}
}
</style>
</head>
<body>
<div id="container">
<h1>CSS Locks</h1>
<p></p>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment