Hello all,
I am in the process of teaching myself CSS to go along with my beginner-intermediate knowledge of HTML. I am just starting with CSS and have created a small test file to attempt to create a table with one row and one cell in that row. I then want to display white text that is centered in the one cell. Below is the current code that I have:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>eBay Test Ad</title>
<style type="text/css">
table.toptable
{
background-color: #000;
margin-left: auto;
margin-right: auto;
border-collapse: collapse;
display: block;
width: 900px;
position: relative;
}
span.testtext
{
text-align: center;
color: #fff;
font-family: Arial, sans serif;
font-weight: bold;
font-size: 32px;
}
</style>
</head>
<body>
<table class="toptable">
<tr>
<td>
<span class="testtext">This is only a test...</span>
</td>
</tr>
</table>
</body>
</html>
It seems to me that by having the statement:
text-align: center;
in the definition of .testtext that it should center this text. I sure this is a very simple fix and I'm just missing something cursory, but any help would be greatly appreciated.
Thanks,
D