Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: <P> class

  1. #1
    Regular Coder
    Join Date
    Sep 2004
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts

    <P> class

    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.
    Code:
    <html lang="en">
    <head>
    
    
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </meta>
    <link rel="stylesheet" type="text/css" href="css.css" />
    
    </head>
    
    <body>
    
    <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>
    </html>
    Code:
    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-
    decoration:none;}
    p.menu {font size: 9px; color: #F00;}

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Edinburgh, UK
    Posts
    402
    Thanks
    2
    Thanked 1 Time in 1 Post
    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.
    Rich

    "An expert is a person who has made all the mistakes that can be made in a very narrow field."

  • #3
    Regular Coder
    Join Date
    Sep 2004
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!
    Thanks.
    PS And no I hadn't found the error because I wasn't looking at the spot I should have been!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •