基于JS的简单猜数小游戏

JS简单猜数小游戏

上图

运行效果
目前只是可以0~100的数,也没写验证,自适应布局啥的。加油吧!
适合刚入门的小白。
多看看Javascript,es6了解吗?
Java,数据库也得看哦。

源码

<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">	
	<title></title>
	<style type="text/css">
	*{
    
     margin:0;
    padding:0;
     }
		body {
    
			font-size: 80%;
			font-family: "微软雅黑"courier monospace;
			letter-spacing: 0.2em;
			
			
			width: 100%;
			min-width: 810px;
			height: 100%;
			min-height: 600px;
				
		}
		#canvas {
    
			position: absolute;
			z-index: -1;
			width: 100%;
			height: 100%;
		}

		#lum{
    
			float: left;
			position: relative;
			width: 20%;
			height:90%;
			border: 10px solid #F1F5C7;
			margin-top: 12px;
			margin-left: 12px;
			margin-right: 12px;
			font-size: 30px;
			background-color: #f8f5ca;
		}

		#page {
    
			float: left;
			max-width: 950px;
			position: relative;
			height: 550px;
			width: 70%;
			margin: 10px auto 10px auto;
			padding: 20px;
			border: 4px double #F1F5C7;
			background-color: pink;
			box-shadow: 10px;
			border-radius: 20px;
			background:url(https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3167149104,3069225610&fm=15&gp=0.jpg)  no-repeat left center;
			background-size: 100% 100%;
		
		}

		#title {
    
			position: absolute;
			width: 200px;
			margin: 5px auto 10px auto;
			font-size: 25px;
			text-align: center;
            box-sizing:border-box;
			left: 0;
			right: 0;
			top: 0;
			bottom
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值