<>问题

星辰紫 2011-12-20 10:11:10

background:url(../images/eintop_sd.jpg) repeat-x center top;
padding-top:55px;

这段CSS 用JS动态控制代码怎么写
...全文
112 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
三石-gary 2011-12-20
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 xing31120 的回复:]

小童 3石 都来拉
[/Quote]

是啊。。。
星辰紫 2011-12-20
  • 打赏
  • 举报
回复
小童 3石 都来拉
星辰紫 2011-12-20
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 zxaioykx 的回复:]

JScript code

document.body.style.background='url(../images/eintop_sd.jpg) repeat-x center top';
document.body.style.paddingTop='55px';
[/Quote]
3Q 虽然我自己找到了这个方法
但是还是要感谢你
小童 2011-12-20
  • 打赏
  • 举报
回复

<!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><title>
无标题页
</title>
<script type="text/javascript">
function ChangeCss()
{
var div = document.all.divMain;
//div = document.body; //换成body即可
div.style.background = "url(1.gif) no-repeat center top";
div.style.paddingTop = "200";
}
</script>
</head>
<body onload="ChangeCss();">
<form name="form1" method="post" id="form1">
<div id= "divMain" style="width:800px; height:800px; border:solid 1px black;">
ss
</div>
</form>
</body>
</html>
三石-gary 2011-12-20
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 zxaioykx 的回复:]

JScript code

document.body.style.background='url(../images/eintop_sd.jpg) repeat-x center top';
document.body.style.paddingTop='55px';
[/Quote]
+1
周祥 2011-12-20
  • 打赏
  • 举报
回复

document.body.style.background='url(../images/eintop_sd.jpg) repeat-x center top';
document.body.style.paddingTop='55px';

87,907

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧