亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

想對div #aaron設置一些屬性沒有成功

<!DOCTYPE?html>
<html>

<head>
????<meta?http-equiv="Content-type"?content="text/html;?charset=utf-8"?/>
????<title></title>
????<script?src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script>
????<style>
????.test1?{
????????background:?#bbffaa;
????}
????
????.test2?{
????????background:?yellow;
????}
?????#aaron?{
????????width:300px;
????????background-color:#639;
????????border:1px?solid?red;
????????height:200px;
????}
????</style>
</head>

<body>
????<h2>通過insertBefore與insertAfter添加元素</h2>
????<button?id="bt1">點擊通過jQuery的insertBefore添加元素</button>
????<button?id="bt2">點擊通過jQuery的insertAfter添加元素</button>
????<div?class="aaron">
????????<p?class="test1">測試insertBefore,不支持多參數</p>
????</div>
????<div?class="aaron">
????????<p?class="test2">測試insertAfter,不支持多參數</p>
????</div>
????<script?type="text/javascript">
????$("#bt1").on('click',?function()?{
????????//在test1元素前后插入集合中每個匹配的元素
????????//不支持多參數
????????$('<p?style="color:red">測試insertBefore方法增加</p>',?'<p?style="color:red">多參數</p>').insertBefore($(".test1"))
????})
????</script>
????<script?type="text/javascript">
????$("#bt2").on('click',?function()?{
????????//在test2元素前后插入集合中每個匹配的元素
????????//不支持多參數
????????$('<p?style="color:red">測試insertAfter方法增加</p>',?'<p?style="color:red">多參數</p>').insertAfter($(".test2"))
????})
????</script>
</body>

</html>

請問#aaron {

? ? ? ? width:300px;

? ? ? ? background-color:#639;

? ? ? ? border:1px solid red;

? ? ? ? height:200px;

? ? }

為什么沒有顯示效果?

正在回答

2 回答

aaron 是class ,用.aaron

0 回復 有任何疑惑可以回復我~

看出來了,=-=

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

想對div #aaron設置一些屬性沒有成功

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號