Skip to content

Instantly share code, notes, and snippets.

@cmaas
Last active February 3, 2021 15:55
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save cmaas/a4d2e87976c2f8d4ce0b to your computer and use it in GitHub Desktop.
HTML5 Page Templates: Basic & Social
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<link rel="stylesheet" href="css/style.css">
<link rel="icon" type="image/png" href="favicon.png">
</head>
<body>
<h1></h1>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Basic Page Needs
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"><!-- optional: ", user-scalable=no" -->
<title></title>
<!-- SERPs & Social
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<meta name="description" content="max 155 characters, written for humans">
<!-- Facebook -->
<meta property="og:url" content="http://www.example.com"><!-- canonical, full url -->
<meta property="og:title" content="Headline Without Site Name">
<meta property="og:description" content="Two to four sentences teaser text.">
<meta property="og:type" content="website"><!-- default=website; use "article" for a blog -->
<meta property="og:image" content="http://www.example.com/image.jpg"><!-- 1200x630 best, 600x315 okay, 200x200 min, <= 8 MB -->
<meta property="og:site_name" content="Site Name"><!-- Site Name without TLD (IMDb, not imdb.com) -->
<!-- Twitter (only after domain approval) -->
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@twitter_username_for_attribution">
<meta name="twitter:title" content="Small Island Developing States Photo Submission">
<meta name="twitter:description" content="View the album on Flickr. Don't repeat the title here.">
<meta name="twitter:image" content="https://farm6.staticflickr.com/5510/14338202952_93595258ff_z.jpg"><!-- 280x150 good, 120x120 min, < 1 MB -->
<!-- CSS & Icons
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/style.css">
<link rel="icon" type="image/png" href="favicon.png">
<!-- Apple Add To Homescreen -->
<link rel="apple-touch-icon" href="apple-touch-icon.png"><!-- don't rename, but use 180x180 -->
<link rel="apple-touch-icon" sizes="76x76" href="images/apple-icon-76.png">
<link rel="apple-touch-icon" sizes="120x120" href="images/apple-icon-120.png">
<link rel="apple-touch-icon" sizes="152x152" href="images/apple-icon-152.png">
<link rel="apple-touch-icon" sizes="167x167" href="images/apple-icon-167.png" >
<link rel="apple-touch-icon" sizes="180x180" href="images/apple-icon-180.png">
</head>
<body>
<h1></h1>
</body>
</html>
/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */
*,::after,::before{box-sizing:border-box}:root{-moz-tab-size:4;tab-size:4}html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}body{font-family:system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji'}hr{height:0;color:inherit}abbr[title]{text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Consolas,'Liberation Mono',Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}::-moz-focus-inner{border-style:none;padding:0}:-moz-focusring{outline:1px dotted ButtonText}:-moz-ui-invalid{box-shadow:none}legend{padding:0}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}
/* MINSTYLE
* - uses CSS variables
* - dark mode enabled
*/
:root {
--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
--color-bg: #fff;
--color-text: #262626;
--color-contrast: #fff;
--color-link: #186ce8;
--color-link-hover: #1943a5;
--color-link-visited: #8e61ec;
--color-line: #D1D5DB;
--color-primary: #CB0072;
--color-secondary: #1fa5bc;
--color-gray-50: #F9FAFB;
--color-gray-100: #F3F4F6;
--color-gray-600: #4B5563;
--color-gray-700: #3F3F46;
}
@media (prefers-color-scheme: dark) {
:root {
--color-bg: #000;
--color-text: #FAFAFA;
--color-contrast: #000;
}
}
/* BASIC PAGE STRUCTURE
* - <body><main><article></article></main><footer></footer></body>
* - sticky footer always at the bottom of the page
*/
body {
background-color: var(--color-bg);
font-family: var(--font-sans);
font-size: 16px;
color: var(--color-text);
/* sticky footer at the bottom */
display: flex;
flex-direction: column;
min-height: 100vh;
line-height: 1.5;
box-sizing: border-box;
}
main {
flex: 1;
}
footer {
margin: 0 auto;
max-width: 50rem;
text-align: center;
}
article {
margin: 0 auto;
max-width: 50rem;
padding-top: 0.4rem;
}
/* ARTICLE STYLES */
a {
color: var(--color-link);
}
a:hover {
color: var(--color-link-hover);
}
a:visited {
color: var(--color-link-visited);
}
hr {
border: 0;
background-color: var(--color-line);
height: 1px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment