本文通过画一个小汽车来展示JavaScript的对象操作
代码如下:
<html>
<head>
<title>JavaScript对象</title>
<style type="text/css">
#car {
font-family:Arial;
}
#body {
position:absolute;
top:50px;
width:80%;
height:100px;
background-color:#000000;
text-align:center;
}
#backwheel {
position:absolute;
left:10%;
top:130px;
background-color:#ffffff;
border:3px solid black;
border-radius:50%;
width:40px;
height:40px;
}
#frontwheel {
position:absolute;
left:55%;
top:130px;
background-color:#ffffff;
border:3px solid black;
border-radius:50%;
width:40px;