我這段代碼為什么不顯示
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
? ? <head>
? ? ? ? <title>操作元素樣式</title>
? ? ? ? <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>
? ? ? ? <link href="style.css" rel="stylesheet" type="text/css" />
? ? </head>
? ??
? ? <body>
? ? ? ? <h3>css()方法設置元素樣式</h3>
? ? ? ? <div id="content">我穿了一件紅色外衣</div>
? ? ? ??
? ? ? ? <script type="text/javascript">
? ? ? ? ? ? $("#content").addClass("blue white");
? ? ? ? </script>
? ? </body>
</html>
2016-05-10
你需要先增加一個blue和white的css樣式,可以在這個代碼中增加:
<style type="text/css">
.red{background-color: red;}
.white{color:white;}
</style>?? 或者是再旁邊那個style.css里面增加
.red{background-color: red;}
.white{color:white;}
2016-04-17
blue white這兩個class在哪呢?我怎么沒看到?