Skip to content

Instantly share code, notes, and snippets.

@k1r8r0wn
Created August 28, 2016 05:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save k1r8r0wn/9589e70e79553698d0ff17cac3a262f4 to your computer and use it in GitHub Desktop.
Save k1r8r0wn/9589e70e79553698d0ff17cac3a262f4 to your computer and use it in GitHub Desktop.
Best practices of css
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1">
<title></title>
<style type="text/css" media="screen">
body {
font-size: calc(1em + .5vw);
}
/* body * + * {
margin-top: 1.5rem;
} */
.text-centered {
text-align: center;
}
.grid {
display: flex;
flex-flow: row wrap;
}
.grid > * {
flex-basis: 10em;
flex-grow: 1;
border: 1px solid black;
}
</style>
<link rel="stylesheet" href="">
</head>
<body>
<div class="text-centered">
<h1>Hello world!</h1>
<h2>Hello world!</h2>
<h3>Hello world!</h3>
<h4>Hello world!</h4>
<p>Hello world!</p>
</div>
<div class="grid text-centered">
<p>Hello!</p>
<p>Hello!</p>
<p>Hello!</p>
<p>Hello!</p>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment