Skip to content

Instantly share code, notes, and snippets.

@cmnstmntmn
Created April 17, 2015 08:53
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 cmnstmntmn/1a670507d6b1776cc283 to your computer and use it in GitHub Desktop.
Save cmnstmntmn/1a670507d6b1776cc283 to your computer and use it in GitHub Desktop.
Elange vertically allingned
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
div {
display:table-cell;
vertical-align: middle;
position:relative;
background-image: url('http://www.keenthemes.com/preview/conquer/assets/plugins/jcrop/demos/demo_files/image2.jpg');
background-repeat:no-repeat;
background-size:cover;
height:200px;
}
div p {
color:green;
background-color:rgba(255, 255, 255, .8);
padding:.5em;
display:inline-block;
}
</style>
</head>
<body>
<div>
<p>Look michaelbrittain, i'm vertically alligned!</p>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment