span和div排版问题(换行问题)
大家看下面的代码:
<script>
function $(id){ return document.getElementById(id);}
function show(){
$( "s1 ").style.display= "block ";
$( "s2 ").style.display= "block ";
}
</script>
<body onload= "show() ">
<span style= "display:none " id= "s1 "> <input type= "checkbox " id= "squid_controller " > squid </span>
<span style= "display:none " id= "s2 "> <input type= "checkbox " id= "squid_controller " > solo </span>
123
</body>
========
我是先把span给隐藏了,再显示出来,可是显示后的每个span都是一行
why?我希望它们紧凑起来。如果搞这个?
如果去掉style和show(),就是我需要的效果了。
------解决方案--------------------style= "width:144px; left:526px; top:150px; display:block overflow-y:auto; "
------解决方案--------------------$( "s1 ").style.display= "inline ";
$( "s2 ").style.display= "inline ";
block会有还行的,只要不为block就行了