anniu1.style.display="none";先用这个隐藏后anniu1.style.display="block"; 再用这个显示出来不居中了``我的代码如下CSS的代码:
#KS
{text-align:center;}HTML的代码:
<div id="KS">
<input id="btn" class="ButtonA" style="display:none;width:300px;" type="submit" />
</div>
请问该怎么样弄``
#KS
{text-align:center;}HTML的代码:
<div id="KS">
<input id="btn" class="ButtonA" style="display:none;width:300px;" type="submit" />
</div>
请问该怎么样弄``
测试用的代码
<!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">
#KS
{text-align:center;} </style>
</head><body>
<div id="KS">
<input id="btn" class="ButtonA" style="width:300px;" type="submit" />
</div>
<input value="qurding" type="button" onclick="ss(document.getElementById('btn'))"/>
<script>
function ss(o){
o.style.display=o.style.display =="none"?"":"none"
}
</script>
</body>
</html>
<div id="KS" style="text-align:center;">
<input id="btn" class="ButtonA" style="width:300px;" type="submit" />
</div>
这样子