10个非常有用的CSS技巧
1. 将网页或元素居中
HTML:
<div class="wrap">
</div><!-- end wrap -->
CSS:
.wrap { width:960px; margin:0 auto;}
2.Sticky Footer (让页脚永远停靠在页面底部,而不是根据绝对位置)
HTML:
<div id="wrap">
<div id="main" class="clearfix">
</div>
</div>
<div id="footer">
</div>
CSS:
* { margin:0; padding:0; }
html, body, #wrap { height: 100%; }
body > #wrap {height: auto; min-height: 100%;}
#main { padding-bottom: 150px; } /* must be same height as the footer */
#footer {
position: relative;
margin-top: -150px; /* negative value of footer height */
height: 150px;
clear:both;}
/* CLEAR FIX*/
.clearfix:after {content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;}
.clearfix {display: inline-block;}
/* Hides from IE-mac */
* html .clearfix { height: 1%;}
.clearfix {display: block;}
/* End&nb
相关文档:
这是原先我写的 备忘的 尽管写的很烂
frame.css
Java代码
CHARSET "UTF-八";
html,body{
margin: 零px;
padding: 零px;
height: 100%;
/*font-size: 12px;
color: #666666;
background: #ffffff;*/
}
*{
margin: 零px;
padding: 零px;
}
/*由于用了相对位置格局,应分辨率太大时,图片和文 ......
当div层为float时,IE6中box左右的margin会加倍
比如:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/htm ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TAO BAO TEST 2&l ......
IE8 自动在兼容模式下运行:
加入这么一行 <meta http-equiv="x-ua-compatible" content="ie=7" />
其内容随著指定的页面模式而更改,当要模拟IE7时,指定IE=IE7,也可以指定IE=6来模仿IE6
区别IE6与FF:
background:orange;*background:blue;
区别IE6与IE7:
background:green !important;background:blue;
......
如果你是网站前端开发人员,那么对你来说,也许做一个漂亮导航菜单会很得心应手。本文要为大家总结各种导航菜单的资源,以便让大家的网站前端开发的工作更
方便更快速,只要选择现成的例子就可以应用于自己的网站了。本文收集的这些资源,从非常简单的HTML和CSS导航菜单,到非常复杂和高级的
JQuer ......