<param name="allowScriptAccess" value="always" /> allowScriptAccess="always"
flash跨域调用外部js
Opera、firefox添加收藏的方法
关键是:rel="sidebar",不用脚本,浏览器会自动识别
试一下
IE6、Firefox2侧栏中打开页面:
<a target="_search" href="http://xxx.com" title="elianba.com">elianba.com</a>
改变文字选中后的背景色(IE下无效):
*::-moz-selection { background-color:#663399; color:#FFFFFF;}自适应宽度圆角矩形(圆太小了吗?)
先说百分比宽度的布局,id为container的div宽度自适应,里面分左右2个部分宽度<=50%(有1px的边框)。代码如下:
<div id="container"> <div class="fleft circle"> <h3>标题</h3> <div>content<br />content<br />content<br /></div> </div> <div class="fright circle"> <h3>标题</h3> <div>content<br />content<br />content<br /></div> </div> </div>
框架结构
以FF为标准:
Ie7对body宽度的计算与FF一样(此时html的宽度与body相同),body高度则是相当于当前浏览器窗口内容区域。
Ie6下html的宽度不可变,始终为当前浏览器窗口内容区域宽度、高度。
锚点选项卡
利用锚点实现选项卡的切换效果,选项卡照理说听该用visibility属性来实现,可是好像大家用的都是display,Why????:
<!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=gb2312" />
<title>锚点 - 选项卡?</title>
<style type="text/css">
body {font:12px "宋体"}
div {height:230px;width:230px;background:#999;overflow:hidden;}
span {display:block;width:230px;height:230px;background:yellow;text-align:center;}
</style>
</head>
<body>
<div><span id="test1">第1个</span><span id="test2">第2个</span><span id="test3">第3个</span><span id="test4">第4个</span></div>
<a href="#test1">第1个</a><a href="#test2">第2个</a><a href="#test3">第3个</a><a href="#test4">第4个</a>
</body>
</html>
EP,迟到了……
Editplus的自动完成功能实在是很强大,可以将常用的大串代码存成片段,用的时候只需要输入自己设定的几个字母就行了。
绝对水平对齐的表单
新浪采用的是在input外嵌套相对定位的div标签,这里直接相对定位并左浮动label标签,input标签相对label绝对定位。
height==line-height时,默认情况下文字并不是绝对垂直居中的:height、line-height同为偶数时上下相差3px,同为奇数时上下相差2px。要达到绝对居中height应为奇数,此时line-height=height+2px,IE7&FF中文字绝对居中。IE6下需设置overflow:hidden。
<!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=gb2312" />
<title>水平对齐的表单 www.etosun.cn</title>
<style type="text/css">
* {margin:0px;padding:0px;}
body {font:12px "宋体";}
.myform {margin:100px auto 0 auto;padding-left:10px;width:490px;height:29px;line-height:31px;overflow:hidden;background:#FFFF00;}
label {position:relative;float:left;width:145px;}
.myform input {position:absolute;}
.uname input, .pw input, .check input{width:80px;top:5px;height:15px;line-height:15px;}
.uname {width:150px;}
.uname input {left:55px;}
.pw {width:140px;}
.pw input {left:45px;}
.check {width:120px;}
.check input{left:55px;width:40px;}
.botton {width:70px;}
.botton input {top:5px;width:61px;height:19px;}
</style>
</head>
<body >
<div class="myform">
<form>
<label class="uname">用户名:<input type="text" name="uname" /></label>
<label class="pw">密码:<input type="password" name="pw" /></label>
<label class="check">验证码:<input type="text" name="check" /></label>
<label class="botton" ><input type="image" name="imageField" id="imageField" src="button.gif" />
</label>
</form>
</div>
</body>
</html>
