Showing posts with label Hack. Show all posts
Showing posts with label Hack. Show all posts

Friday, April 10, 2009

EmulatingFixedPositioning in IE


/* For fixed positioning savvy browsers */
.fixed{
position: fixed;
}

#header{
top: 0;
left: 0;
height: 80px;
}

#footer{
bottom: 0;
left: 0;
height: 30px;
}

body{
padding: 80px 0 30px;
}

/* For IE for Windows \*/
* html{
width: 100%;
height: 100%;
overflow: hidden;
}

* html body{
width: 100%;
height: 100%;
overflow: auto;
}

* html .fixed{
position: absolute;
}
/* */

Reference: http://css-discuss.incutio.com/?page=EmulatingFixedPositioning

Wednesday, August 20, 2008

如何使div内容居中


#div1, #div2 {
display: table-cell;
*display: inline; /* hack ie */
height: 200px;
vertical-align: middle;
border: #000 1px solid;
}

Friday, January 25, 2008

HTML5 Shiv

source article link: http://ejohn.org/blog/html5-shiv/


<html>
<head>
<style>blah { color: red; }</style>
<script type="text/javascript">document.createElement("blah")</script>
</head>
<body>
<blah>Hello!</blah>
</body>
</html>