Skip to content

Instantly share code, notes, and snippets.

@J3698
Last active March 12, 2019 17:39
Show Gist options
  • Save J3698/6f8184ad29c51b756437c1678a4a3461 to your computer and use it in GitHub Desktop.
Save J3698/6f8184ad29c51b756437c1678a4a3461 to your computer and use it in GitHub Desktop.
A mobile-friendly website
<!DOCTYPE html>
<html lang="en">
<head>
<title>My Site</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"</meta>
<style>
#header {
position: absolute;
top: 0; left: 0;
width: 100%;
background-color: black;
color: white;
font-size: 350%;
}
p {
margin-top: 20%;
text-align: center;
font-size: 250%;
}
@media only screen and (max-width: 420px) {
#header {
font-size: 300%;
}
p {
margin-top: 70%;
font-size: 200%;
}
#desktop-notif {
display: none;
}
}
</style>
</head>
<body>
<div id="header">Header</div>
<p>Hey, I'm some beautiful content!</p>
<p id="desktop-notif">You are on desktop :)</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment