SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2000
    Location
    Grosseto, Italy
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    using :hover inline

    I am tryng to do something like this but err...it doesn't work

    <a href="faqs.asp" target="_top" STYLE="text-decoration: none; color: #000000; :hover {color: #CC3300};">FAQS</a>

    The text should be black and when the mouse goes over it should become red.
    what am I doing wrong?

    thank you

  2. #2
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,223
    Mentioned
    154 Post(s)
    Tagged
    0 Thread(s)
    im pretty sure you cant do it that way.

    Code:
    <style type="text/css">
     a {
       color: black;
     }
     a:hover {
       color: red;
     }
    </style>
    
    <a href="#">Link is black, but when hovered is red</a>

  3. #3
    SitePoint Zealot
    Join Date
    Dec 2000
    Location
    Grosseto, Italy
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know how to use it in the STYLE tag but I thought I could do it also in line. That would be useful in the situation I am. Tought it's bad if I can only use it in the style tag


  4. #4
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,223
    Mentioned
    154 Post(s)
    Tagged
    0 Thread(s)
    Tought it's bad if I can only use it in the style tag
    Who told you that? XHTML, XML, and HTML 4.0 standards all request that you define all font properties, table properties, and any other tags properties through CSS either by the <style> tags, external style sheet, or using the style="blah" method.

    -Matt

  5. #5
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    tabsquare...the CSS way is better, easier and more efficient than the way you're trying to do it.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  6. #6
    SitePoint Zealot
    Join Date
    Dec 2000
    Location
    Grosseto, Italy
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh...ok then
    I said that because I have a lot of links each one looking different from each other. Maybe being able to use the hover event inline could have made the code easier to read.
    And I am also very new to CSS.

    But there's no problem, I placed everything in the <style> tag abd the pages works very well.


Bookmarks

Posting Permissions

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