Skip to content

Instantly share code, notes, and snippets.

@graphicbeacon
Created June 20, 2020 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save graphicbeacon/002fed4e491d4bc2f9bf496dfa998f26 to your computer and use it in GitHub Desktop.
Save graphicbeacon/002fed4e491d4bc2f9bf496dfa998f26 to your computer and use it in GitHub Desktop.
Centering card with Materialize example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
</head>
<body>
<div class="valign-wrapper grey">
<div class="row">
<div class="col s12 m6 offset-m3">
<div class="card blue-grey darken-1">
<div class="card-content white-text">
<span class="card-title">Card Title</span>
<p>I am a very simple card. I am good at containing small bits of information.
I am convenient because I require little markup to use effectively.</p>
</div>
<div class="card-action">
<a href="#">This is a link</a>
<a href="#">This is a link</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
html, body {
height: 100%;
}
.valign-wrapper {
height: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment