HTML版扫雷

页面初始化界面:
在这里插入图片描述
踩雷结束游戏图:
在这里插入图片描述
直接上HTML代码!

<!DOCTYPE html>
<html lang='zh'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>扫雷</title>
<style>
    html, body{
     
        margin: 0;
        padding: 0;
    }
    .main {
     
        display: flex;
        flex-shrink: 0;
        align-items: center;
        flex-direction: column;
        justify-content: center;
    }
    #box{
     
        border: 5px solid black;
        overflow: hidden;
        width: 900px;
        min-width: 900px;
        background-color: #ccc;
        /* background: url('https://ftp.bmp.ovh/imgs/2020/08/8d1866509f36d99f.jpg') no-repeat; */
        background-size: 900px 450px;
    }
    #box > div{
     
        cursor: pointer;
    }
    #box > .block{
     
        width: 20px;
        height: 20px;
        background-color: rgb(192, 192, 192);
        float: left;
        border-left:5px solid #fff;
        border-top:5px solid #fff;
        border-bottom:5px solid rgb(128, 128, 128);
        border-right:5px solid rgb(128, 128, 128);
    }
    #box > .block:hover{
     
        background-color: rgb(192, 192, 192);
        border:0;
        border-top: 2px solid rgb(138, 138, 138);
        border-left: 2px solid rgb(138, 138, 138);
        width: 28px;
        height: 28px;
    }
    #box > .show{
     
        width: 30px;
        height: 30px;
        background-color: rgba(0, 0, 0, 0.1);
        color: #fff;
        /* background-color: transparent; */
        float: left;
        font-size: 16px;
        line-height: 30px;
        text-align: center;
        font-weight: bold;
    }
    #box > .bomb{
     
        width: 24px;
        height: 24px;
        border: 3px solid rgba(255, 100, 100, 0.4);
        background-color: rgba(0, 0, 0, 0.1);
        float: left;
    }
    .main .header {
     
        flex-shrink: 0;
        height: 100px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .main #time{
     
        width: 100px;
        height: 40px;
        margin-right: 40px;
        line-height: 40px;
        background: #ccc;
        border-radius: 5px;
        font-size: 24px;
        font-weight: bold;
        text-align: center;
    }
    .main input {
     
        border: 0;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        height: 40px;
        width: 100px;
        border: 2px #ccc solid;
        border-radius: 5px;
        font-size: 24px;
        font-weight: 600;
        padding: 0 5px;
    }
  • 7
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值