游戏开发中经常要用到平铺背景,用ps等工具看效果感觉没必要,于是用html直接看看平铺效果还是比较简单轻量的
index.html代码如下:
<!DOCTYPE html>
<html>
<head>
<style>
.bg {
background-image: url("tu2.jpg");
background-repeat: repeat;
background-position: center;
/* width: 1000px;
height: 500px; */
}
</style>
</head>
<body class="bg">
<div></div>
</body>
</html>