I'm doing a tool to help in a game. The original game looks like this:
I was able to do the elixir number on the purple drop on the top-left. The transparent label to show the Level. (still need to work with the right colors based in card rarity).
But cant make the label center on the bottom and if possible looks like inside the border instead of above the whole picture.
I was trying following this question CSS center text (horizontally and vertically) inside a div block but haven't be able to make it work.
.elixir {
position: absolute;
top: 5px;
left: 15px;
color: white;
font-weight: bold;
font-size: 50px;
}
.level {
color: white;
font: bold 24px/45px Helvetica, Sans-Serif;
letter-spacing: -1px;
background: rgb(0, 0, 0);
/* fallback color */
background: rgba(0, 0, 0, 0.7);
padding: 10px;
text-align: center;
}
#header {
position: relative;
background: yellow;
width: 200px;
}
#header-content {
position: absolute;
bottom: 0;
color: Violet ;
font: bold 24px/45px Helvetica, Sans-Serif;
letter-spacing: -1px;
background: rgb(0, 0, 0);
/* fallback color */
background: rgba(0, 0, 0, 0.7);
padding: 10px;
/* width: 100%; */
line-height: 40px;
}
<div id="header">
<img src="https://vignette.wikia.nocookie.net/clashroyale/images/4/46/DarkPrinceCard.png/revision/latest?cb=20160702201038" />
<span class="elixir"> 4 </span>
<span id="header-content"> Level 2 </span>
</div>