HTML and CSS Reference
In-Depth Information
3. Then, we define the styles that lay out the user interface of the game. Let's put
them in the game.css file:
#game {
position: relative;
width: 640px;
height: 1000px;
}
#canvas {
position: absolute;
background-color: #ddd;
}
#hud {
position: absolute;
width: 100%;
height: 60px;
background: rgba(0, 0, 0, 0.5);
color: white;
}
.add-buttons {
position: absolute;
width: 100%;
height: 60px;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
}
.add-button {
display: inline-block;
width: 50px;
height: 50px;
background-color: rgba(255, 255, 255, 0.3);
color: white;
text-decoration: none;
text-align: center;
line-height: 50px;
cursor: pointer;
}
.add-button:hover {
background-color: rgba(255, 255, 255, 0.6);
}
 
Search WWH ::




Custom Search