CSS链接引入经验
今天写了一个简单的网页,请看代码:错误的:
结论: rel是Relations的缩写 指关联到一个stylesheet(样式表单) 在标签中,“rel=stylesheet”,rel是关联的意思,关联的是一个样式表(stylesheet)文档,它表示这个link在文档初始化时将被使用。切忌漏写rel,否则引入的CSS无效!
相关文档:
.ie
{
border:1px solid #000000;
width:100px;
height:300px;
font-size:12px;
}
.ie div
{ text-over:
overflow:hidden;
text-overflow:ellipsis ......
jQuery插件: jquery.widget.shadowbox.js
/**
* 一个简单的设置DIV阴影的插件
*
* 功能:
* 1. 根据阴影宽度自动调整外层容器宽度,以及透明度
* 2. 可定义ShadowBox的宽度和高度
* 3. 可用CSS样式表定义可视化样式
*
* @author joe.he <developerworks@163.com>
* @copyright irgs.cn
*/
(fun ......
使用 line-height 垂直居中
line-height:24px;
使用固定宽度的容器并且需要一行垂直居中时,使用 line-height 即可(高度与父层容器一致),更多的垂直居中总结可以看这里。
清除容器浮动
#main {
overflow:hidden;
}
不让链接折行
a {
white-space:nowrap;
}
上面的设定就能避免链接折行,不过个 ......
1.区别IE和Firefox
.title {
background:blue; /*Firefox */
background:red \9; /*IE6、IE7、IE8*/
}
2.区别IE6、IE7、IE8、Firefox
.title {
background:blue; /*Firefox */
background:red \9; /*IE6、IE7、IE8 */
*background:black; /*IE7 */
_background:orange; /*IE6 */
}
注意,无论怎样,都是FireFox ......
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
.main{position:relative;width:100%}
.left{position:absolute;width:200px;border:solid 1px red; height: ......