Created
March 19, 2013 15:30
-
-
Save joseadrian/5197076 to your computer and use it in GitHub Desktop.
Posicionar elemento al centro horizontal y verticalmente
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
* {margin: 0;padding: 0} | |
html,body {height: 100%} | |
#table { | |
height: 100%; | |
display: table; | |
width: 100%; | |
} | |
#cell { | |
display: table-cell; | |
vertical-align: middle; | |
} | |
#content { | |
width: 960px; | |
background: #3d3d3d; | |
margin: 0 auto; | |
} | |
/* <!--[if lte IE 7]> */ | |
#ie-container { | |
position: relative; | |
float: left; | |
top: 50% | |
} | |
#content{ | |
top: -50%; | |
position: relative; | |
} | |
/* <![endif]--> */ |
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 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
</head> | |
<body> | |
<div id="table"> | |
<div id="cell"> | |
<div id="ie-container"> | |
<div id="content"> | |
<p>Contenidot</p> | |
</div> | |
</div> | |
</div> | |
</div> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment