springboot怎么把数据传给前端:springboot 如何引入前端 bootstrap?
这种问题网上一搜一大堆,你可以具体找一篇文章试试,遇到问题可以针对相关问题去提问。springboot通过jar包方式引入bootstrap_个人文章 - SegmentFault 思否 这不是查查就
顺晟科技
2022-10-18 12:17:57
121
我正在尝试用JS、HTML和CSS制作一个游戏,其中我使用HTML打开一个包/库存菜单。然而,当尝试将我的按钮定位到游戏屏幕(画布)的右下角时,画布的大部分被切断,使其无法运行。
这是我看到的,下面是我的代码。
function setup() {
game = new Game;
player = new Player;
controller = new Controller;
canvas.width = 800;
canvas.height = 600;
}
@font-face { font-family: "04b_03"; src: url("assets/fonts/04B_03__.TTF"); }
:root {
--background: 15, 15, 15;
--outline: 255, 160, 30;
}
html, body {
/* Prevent scrollbars */
overflow: hidden;
/* Background */
background-color: rgb(var(--background));
/* Text */
font-family: "04b_03", sans-serif;
/* font-family: "Staatliches", cursive; */
font-size: 200%;
color: white;
}
.container {
position: relative;
width: auto;
height: auto;
}
canvas {
/* Center */
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
/* Border */
border: 10px solid white;
border-radius: 25px;
box-shadow: 0 0 50px rgba(255, 255, 255, 0.4);
/* Rendering */
image-rendering: pixelated;
/* Positioning */
z-index: 1;
}
.bag {
position: absolute;
right: 5%;
bottom: 5%;
z-index: 2;
}
<代码><;身体>;开火<;DIV类=“容器”>;<;画布ID=“ canvas ”>;您的浏览器不支持HTML画布:(<;/canvas>;<;按钮类=“包”>;袋子<;/纽扣>;<;/DIV>;<;/正文>;我
该怎么解决这个问题?每当我使用<body>
FIRE
<div class = "container">
<canvas id = "canvas"> Your browser does not support the HTML canvas :( </canvas>
<button class = "bag"> Bag </button>
</div>
</body>
定位时,容器就会缩小,但我不认为有任何其他方法可以做到这一点。如果最终用户决定缩放其屏幕,则使用relative
定位将在按钮位置中产生错误,因此我试图寻找一种解决方案,使按钮始终停留在画布上的同一位置。
顺晟科技:
没关系,我让它工作了。我在我的容器CSS上使用了固定定位。在这里:
absolute
05
2022-12
02
2022-12
02
2022-12
29
2022-11
29
2022-11
24
2022-11