CSS:
.level0 ul {list-style-type: none; height: 80px; width: 600px; margin: auto;}
.level0 li {float: left;}
.level1 ul {list-style-type: none; height: 80px; width: 600px; margin: auto;}
.level1 li {float: left;}
.level2 ul {list-style-type: none; height: 80px; width: 600px; margin: auto;}
.level2 li {float: left;}
Run Code Online (Sandbox Code Playgroud)
jss中的CSS:
<script>
function getId(id){
$('.level'+id +' ul').css('list-style-type: none', 'height: 80px', 'width: 600px', 'margin: auto');
$('.level'+id +' li').css('float: left');
}
</script>
Run Code Online (Sandbox Code Playgroud)
当我使用css正常是可以的,但是当在javascript中使用css时出错,你能帮助我吗?