I'm building a website for my high school so students to view their class schedules online. Each class has a different background color. On the main page, I do this by changing the background color of a <td>
tag.
On the settings page, I want to allow users to change this color, using a color input.
I want to overlay text over each of these inputs (the users class name, like 'math' for that block) so the user can make sure that they are choosing a readable color. It also is a cool way to show which input goes to each block.
When I include a <span>
, it goes next to the input, not over it. Any ideas? Thanks!
.colorInput {
display: block;
margin-left: auto;
margin-right: auto;
margin-top: 20px;
background-color: transparent;
border: solid 0px;
height: 50px;
width: 100px;
}
<form>
<table>
<tr>
<input type="color" class="colorInput" id="color1" />
<input type="color" class="colorInput" id="color2" />
<input type="color" class="colorInput" id="color3" />
<input type="color" class="colorInput" id="color4" />
<input type="color" class="colorInput" id="color5" />
<input type="color" class="colorInput" id="color6" />
<input type="color" class="colorInput" id="color7" />
</tr>
</table>
</form>
Example: