I am currently in the process of creating a website for my high school that will allow students to access their class schedules online. To differentiate each class, I have assigned them different background colors. This is achieved on the main page by adjusting the background color of a <td>
tag.
For the settings page, I would like to provide users with the ability to customize these colors using a color input feature.
To enhance user experience, I intend to overlay text onto each color input field indicating the corresponding class (e.g., 'math') to ensure readability and also establish a clear connection between the input and its associated block.
Though when I attempt to use a <span>
, it appears beside the input rather than over it. Any suggestions or solutions would be greatly appreciated. Thank you!
.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: