Welcome to HBH! If you had an account on hellboundhacker.org you will need to reset your password using the Lost Password system before you will be able to login.

css not applying to page


ghost's Avatar
0 0

Hello everyone,

I am new to html and css. I have been doing it for about 3 weeks. I am learning a lot but there's a lot I don't yet understand. I'm trying to make a calendar for January with the weekdays, weekends, and holidays each in separate colors.

Also, the number for the date should be in the upper right corner of the cell and the name of the holiday should appear in the center of the cell. With just html I got it perfect, exactly how I need. I have a book and I have been visiting w3schools. I just need a little help from someone who understands css. This is what I have so far:

<html>

&lt;head&gt;	
	&lt;title&gt;Calendar&lt;/title&gt;


	&lt;style type=&quot;text/css&quot;

		p.holiday {	text-align: center;
		}


		td {	color: #ff0000;
			background-color: 000ff;
		}

		td.holiday {	color: #ff6600;
				background-color: ff0ff;
		}


		td.weekend {	color: 0ff00;
				background-color: #ff00ff;
		}

		tr {	height: 80px;
			text-align: right;
			vertical-align: top;
			width: 150px;
		}

	&lt;/style&gt;

&lt;/head&gt;

&lt;body&gt;

	&lt;table align=&quot;center&quot; border=&quot;1&quot; cellspacing=&quot;1&quot; cellpadding=&quot;1&quot; summary=&quot;January&quot;&gt;
		
		&lt;caption&gt;January&lt;/caption&gt;
		&lt;th&gt;Sunday&lt;/th&gt;
		&lt;th&gt;Monday&lt;/th&gt;
		&lt;th&gt;Tuesday&lt;/th&gt;
		&lt;th&gt;Wednesday&lt;/th&gt;
		&lt;th&gt;Thursday&lt;/th&gt;
		&lt;th&gt;Friday&lt;/th&gt;
		&lt;th&gt;Saturday&lt;/th&gt;

		&lt;tr&gt;
			&lt;td class=&quot;weekend&quot;&gt; &lt;/td&gt;
			&lt;td&gt; &lt;/td&gt; 
			&lt;td class=&quot;holiday&quot;&gt;1&lt;p class=&quot;holiday&quot;&gt;New Year&#39;s Day&lt;/p&gt;&lt;/td&gt;
			&lt;td&gt;2&lt;/td&gt;
			&lt;td&gt;3&lt;/td&gt;
			&lt;td&gt;4&lt;/td&gt;
			&lt;td class=&quot;weekend&quot;&gt;5&lt;/td&gt;
		&lt;/tr&gt;
		
		&lt;tr&gt;
			&lt;td class=&quot;weekend&quot;&gt;6&lt;/td&gt;
			&lt;td&gt;7&lt;/td&gt; 
			&lt;td&gt;8&lt;/td&gt;
			&lt;td&gt;9&lt;/td&gt;
			&lt;td&gt;10&lt;/td&gt;
			&lt;td&gt;11&lt;/td&gt;
			&lt;td class=&quot;weekend&quot;&gt;12&lt;/td&gt;
		&lt;/tr&gt;

		&lt;tr&gt;
			&lt;td class=&quot;weekend&quot;&gt;13&lt;/td&gt;
			&lt;td&gt;14&lt;/td&gt; 
			&lt;td&gt;15&lt;/td&gt;
			&lt;td&gt;16&lt;/td&gt;
			&lt;td&gt;17&lt;/td&gt;
			&lt;td&gt;18&lt;/td&gt;
			&lt;td class=&quot;weekend&quot;&gt;19&lt;/td&gt;
		&lt;/tr&gt;

		&lt;tr&gt;
			&lt;td class=&quot;weekend&quot;&gt;20&lt;/td&gt;
			&lt;td class=&quot;holiday&quot;&gt;21&lt;p class=&quot;holiday&quot;&gt;Martin Luther King&lt;/td&gt; 
			&lt;td&gt;22&lt;/td&gt;
			&lt;td&gt;23&lt;/td&gt;
			&lt;td&gt;24&lt;/td&gt;
			&lt;td&gt;25&lt;/td&gt;
			&lt;td class=&quot;weekend&quot;&gt;26&lt;/td&gt;
		&lt;/tr&gt;

		&lt;tr&gt;
			&lt;td class=&quot;weekend&quot;&gt;27&lt;/td&gt;
			&lt;td&gt;28&lt;/td&gt; 
			&lt;td&gt;29&lt;/td&gt;
			&lt;td&gt;30&lt;/td&gt;
			&lt;td&gt;31&lt;/td&gt;
			&lt;td&gt; &lt;/td&gt;
			&lt;td class=&quot;weekend&quot;&gt; &lt;/td&gt;
		&lt;/tr&gt;
	&lt;/table&gt;
&lt;/body&gt;

</html>

None of the formatting appears when I view the page. What am I doing wrong?

Thanks in advance for any help.


spyware's Avatar
Banned
0 0

Check your opening-style tag.


ghost's Avatar
0 0

spyware wrote: Check your opening-style tag.

Agreed. Unless you typo'd, you forgot a ">".


ghost's Avatar
0 0

close tag in the beginning . to td ??? . to tr ??? <style type="text/css">

p.holiday { text-align: center; }

td. { color: #ff0000; background-color: 000ff; }

td.holiday { color: #ff6600; background-color: ff0ff; }

td.weekend { color: 0ff00; background-color: #ff00ff; }

tr. { height: 80px; text-align: right; vertical-align: top; width: 150px; }

</style>


ghost's Avatar
0 0

The missing '>' was a typo on my part. I guess I was reading right over that. Thanks.

With that, I thought that I probably made other typos, and I did.

Sometimes you need a fresh set of eyes. Thanks for the help.