I just started learning HTML and CSS on my own and getting a hang of general rules and it's becoming easier but this one I can't wrap my head around. I wrote this just to get a hang of tables and rows but the border property is not applied unless I use
.city th {
but the background property and color is applied even with just
.city {
This is the basic code I wrote and was wondering if there was something simple I missed or something I am not understanding correctly.
<head>
<style>
.even {
background-color: blue;
}
.city th {
border-top: 5px solid red;
border-top-left-radius: 5px;
background-color: gray;
color: white;
}
</style>
</head>
<body>
<h1>Poetry Workshops</h1>
<p>We will be conducting a number of poetry workshops and symposiums
throughout the year.</p>
<p>Please note that the following events are free to members:</p>
<div class="list">
<ul>
<li>A poetic Perspective</li>
<li>Walt WHitman at War</li>
<li>Found Poems and Outsider Poetry</li>
</ul>
</div>
<table>
<tr class="city">
<th></th>
<th>New York</th>
<th>Chicago</th>
<th>San Francisco</th>
</tr>
<tr>
<td>A poetic perspective</td>
<td>Sat, 4 Feb 2012 11am - 2pm</td>
<td>Sat, 3 Mar 2012 11am - 2pm</td>
<td>Sat, 17 Mar 2012 11am - 2pm</td>
</tr>
<tr class="even">
<td>Walt Whitman at War </td>
<td>Sat, 7 Apr 2012 11am - 1pm</td>
<td>Sat, 7 Apr 2012 11am - 1pm</td>
<td>Sat, 7 Apr 2012 11am - 1pm</td>
</tr>
<tr>
<td>Found Poems & Outsider Poetry</td>
<td>Sat, 7 Apr 2012 11am - 1pm</td>
<td>Sat, 7 Apr 2012 11am - 1pm</td>
<td>Sat, 7 Apr 2012 11am - 1pm</td>
</tr>
<tr class="even">
<td>Natural Death: An Exploration</td>
<td>Sat, 7 Apr 2012 11am - 1pm</td>
<td>Sat, 7 Apr 2012 11am - 1pm</td>
<td>Sat, 7 Apr 2012 11am - 1pm</td>
</tr>
</table>