<link rel="stylesheet" type="text/css" href="css/style.css">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("#btn1").click(function(){
$("p").append(" <b>Appended text</b>.");
});
$("#btn2").click(function(){
$("#d87").append("<div id='d76'>H</div>").;
});
});
</script>
</head>
<body>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<ol>
<li>List item 1</li>
<li>List item 2</li>
<li>List item 3</li>
</ol>
<button id="btn1">Append text</button>
<button id="btn2">Append list item</button>
</body>
</html>
<div id="d87"></div>
当我按下附加列表项时我通过css创建的框在向下方向滑动。我希望它向右滑动,每次单击按钮时,它都应移到上一个框的右侧100px
。
答案 0 :(得分:0)
#d87{
margin-left:100px;
float:left;
}