会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
木头wood
倾听每一刻——listen
博客园
首页
新随笔
联系
管理
订阅
IE6/7的text-indent与text-align的bug
Code
1
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
2
<
html
xmlns
="http://www.w3.org/1999/xhtml"
>
3
<
head
>
4
<
meta
http-equiv
="Content-Type"
content
="text/html; charset=utf-8"
/>
5
<
title
>
无标题文档
</
title
>
6
<
style
>
7
*
{
}
{
margin
:
0
;
padding
:
0
;
}
8
</
style
>
9
<
script
>
10
function
move()
{
11
var
a
=
document.getElementById(
"
button
"
);
12
for
(
var
i
=
0
,len
=
100
;i
<
len;i
+=
20
)
{
13
a.style.textIndent
=
i
+
"
px
"
;
14
alert(a.style.textIndent);
15
}
16
}
17
</
script
>
18
</
head
>
19
<
body
onload
="move()"
>
20
<
div
style
="width:500px;height:500px;margin:100px auto;background:#0FF;text-align:center;"
><
button
id
="button"
type
="submit"
style
="border:none; width:203px;height:52px;background-color:#FF4C00;cursor:pointer;overflow:hidden;"
>
立即发布
</
button
></
div
>
21
22
</
body
>
23
</
html
>
1.在IE6/7下,button可以随着text-indent的值不同而移动,FF和IE8则不会!
2.当设置button的displa:block;时,设置其父元素的text-align:center;,IE6/7的button会水平居中,真奇怪啊!
posted @
2009-09-27 12:40
木头wood
阅读(
1734
) 评论(
0
)
收藏
举报
刷新页面
返回顶部
公告