网页布局CSS技巧 Web设计必知
两列布局
1、左列固定,右列自适应
#left{ width:190px; float:left; }
#right{ margin-left:205px; }
2、右列固定,左列自适应
#left{ float:left; width:100%; }
#right{ float:left; margin-left:-100px; width:100px; }
三列布局
左右宽度固定,中间自适应
#left{ float:left; width:200px; }
#middle{ margin:0 210px; }
#right{ float:right; width:200px; }
至于HTML代码,我想没有必要贴出来了,有这三个作对照,常用的网站布局应该都可以搞定。
相关文档:
1.span 的 overflow :hidden width:70px ; display:block(一点要加上div的话不用加)
2.js动态换背景,换背景 style.backgroundImage = "url('images/bg1.jpg')";
3.用onFocus="this.blur()"来消除链接后的焦点虚线框
4. onMouseOver onMouseOut onClick 三个时间在一 ......
CSS语法 (不区分大小写) JavaScript语法 (区分大小写)
border border
border-bottom borderBottom
border-bottom-color borderBottomColor
border-bottom-style borderBottomStyle
border-bottom-width borderBottomWidth
border-color borderColor
border-left borderLeft ......
大多数人很容易将CSS属性display和visibility混淆,它们看似没有什么不同,其实它们的差别却是很大的。
visibility属性用来确定元素是显示还是隐藏,这用visibility="visible|hidden"来表示,visible表示显示,hidden表示隐藏。当visibility被设置为"hidden"的时候,元素虽然被隐藏了,但它仍然占据它原来所在的位置 ......
还算不错的文章,虽然条理性不是非常清楚,也转贴收了吧,方便查资料。
CSS对浏览器器的兼容性具有很高的价值,通常情况下IE和Firefox存在很大的解析差异,这里介绍一下兼容要点。
常见兼容问题:
1.DOCTYPE 影响 CSS
处理
2.FF: div 设置 margin-left, margin-right 为 auto 时已经 ......
<!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>三级dropdown弹出 ......