Created
April 17, 2015 08:53
-
-
Save cmnstmntmn/1a670507d6b1776cc283 to your computer and use it in GitHub Desktop.
Elange vertically allingned
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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