前言
用戶選擇出石頭剪刀布,電腦系統(tǒng)隨機(jī)生成石頭剪刀布,然后判斷結(jié)果并顯示給用戶
一、實(shí)現(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>請(qǐng)選擇</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>結(jié)果顯示中。。。</p> </div> </body>
文章題目:js實(shí)現(xiàn)石頭剪刀布游戲-創(chuàng)新互聯(lián)
分享路徑:http://www.rwnh.cn/article12/pdidc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供云服務(wù)器、網(wǎng)站維護(hù)、服務(wù)器托管、搜索引擎優(yōu)化、定制開發(fā)、營(yíng)銷型網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容