Learning CSS has been an interesting journey so far. It's not always as intuitive as one might think, especially in web development. :)
I recently attempted to create a simple, static progress bar using the following HTML file:
<html>
<head></head>
<body>
<table border='1' cellspacing='0'>
<tr>
<td>Sample Cell</td>
<td>
<!-- This is meant to be a progress bar -->
<div style="background-color: #0a0; width: 20%;">
<div style="text-align: center; width: 300px;">
Text Here!
</div>
</div>
</td>
</tr>
</table>
</body>
</html>
The result looks promising, however, I noticed that the width of the second column is fixed. When I tried changing width: 300px
to width: 100%
, the text ended up inside the green box rather than filling the entire table cell.
I'm now wondering how I can make the text fill the whole table cell without specifying a specific length restriction. Any suggestions?