前言

用戶選擇出石頭剪刀布,電腦系統(tǒng)隨機生成石頭剪刀布,然后判斷結果并顯示給用戶
一、實現(xiàn)效果

二、使用步驟
1.HTML和CSS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>石頭剪刀布</title>
<style>
#bigbox{
width: 600px;
height: 600px;
background: slateblue;
margin: 0 auto;
}
#bigbox>h2{
width: 100%;
text-align: center;
color: #ffffff;
}
.box1{
height: 200px;
}
.box2{
height: 220px;
}
.box1 img{
float: left;
margin: 25px;
}
.box2 img{
float: left;
margin:20px 63px;
width: 150px;
height: 150px;
}
.box2 h2{
display: block;
color: #000;
float: left;
line-height: 150px;
}
img{
width: 150px;
height: 150px;
}
p{
text-align: center;
color: red;
font-size: 20px;
font-weight: bold;
}
.text{
height: 20px;
}
.text span{
font-size: 20px;
color: #ffffff;
margin: 0 100px;
line-height: 20px;
}
</style>
</head>
<body>
<div id='bigbox'>
<h2>請選擇</h2>
<div class="box1">
<img src="../img/shitou.png" alt="">
<img src="../img/jiandao.png" alt="">
<img src="../img/bu.png" alt="">
</div>
<div class="text">
<span>您選擇了</span>
<span>系統(tǒng)選擇了</span>
</div>
<div class="box2">
<img src="../img/undefined.png" alt="">
<h2>pk</h2>
<img src="../img/undefined.png" alt="">
</div>
<p>結果顯示中。。。</p>
</div>
</body>
文章題目:js實現(xiàn)石頭剪刀布游戲-創(chuàng)新互聯(lián)
分享路徑:http://chinadenli.net/article12/pdidc.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供云服務器、網(wǎng)站維護、服務器托管、搜索引擎優(yōu)化、定制開發(fā)、營銷型網(wǎng)站建設
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)