View Full Version : <P> class

10-22-2004, 04:32 AM
Hey I'm kind've confused right now. I'm just messing around with HTML not on the internet just on notepad and came across a problem. When I put in the following HTML , the Menu and the items are normal links at first but when you hover over them, they change and take the values of the other links even when I have in my style sheet p.menu. Here's the html and the css.

<html lang="en">

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="css.css" />



<h1> blah blah blah </h1>
<h2>blah blah blah</h2>
<p> this is a test</p>
<p><a href="http://www.codingforums.com"><b>CodingForums.com</b></a>-
Web coding and development forums. Visit <a href="http://www.codingforums.com">CodingForums</a> for help on JavaScript, PHP, CGI, XML, web building, and more.</p>

<p><a href="http://home.comcast.net/%7Etrampball/index.html>blah blah </a>

<p class ="menu">Menu<br>
Item 1<br>
Item 2<br>
Item 3<br>
Item 4<br></p>


body {background-color: 3399FF
h1 {background-color: #0000f; text-align:center}
h2 {background-color: transparent}
p {background-color: transparent}
a:link {background-color: transparent}
a:visited {color:#333333; background-color: transparent;}
a:hover {color:yellow; background-color: transparent; text-
p.menu {font size: 9px; color: #F00;}

10-22-2004, 12:47 PM
Not sure whether you've worked it out yet, but if you haven't it's just a case of putting a closing quotation mark in your last link:

You had:
<a href="http://home.comcast.net/%7Etrampball/index.html>blah blah </a>

And you needed:
<a href="http://home.comcast.net/%7Etrampball/index.html">blah blah </a>

This then ends your link and the browser doesn't think that all the text is the link.

I hope this helps.

10-22-2004, 06:43 PM
Hey, thanks a lot. I wasn't really looking at the links when trying to troubleshoot the error, but I guess I should have becasue the items are turning into links!
PS And no I hadn't found the error because I wasn't looking at the spot I should have been!