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