Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: text-decoration onmouseover not working in FF...yes, there's a doctype

  1. #1
    Join Date
    Aug 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default text-decoration onmouseover not working in FF...yes, there's a doctype

    Hey folks...been stuck on this one for way too long...this small snippet of code should work in Firefox, yet it does not...

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title> new document </title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    </head>

    <body>
    <input type="submit" name="registry" value="WTF" onmouseover="this.style.textDecoration = 'underline';" onmouseout="this.style.textDecoration = 'none';" />
    </body>
    </html>

  2. #2
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    This isn't CSS, well... Let me correct myself. This is a javascript command declaring CSS variables. I think you would probably find more help for this in the "Javascript" section seeing as how the part you are having trouble with is Javascript
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  3. #3
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    Check your DOCTYPE tag... Once I removed the DOCTYPE from the equation it worked fine in FF
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  4. #4
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    There is a restriction on where you can use text-decoration and I am almost positive that input fields fall into that restriction.

    PS The official abbreviation for Firefox is Fx

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    If you have any valid URL DOCTYPE it will not work. This means that FF thinks (and it may well be right) that according to standards, the text-decoration style property doesn't apply to input elements (at least when their type is submit, and by extension, probably at least button as well, perhaps all input elements).
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    Ah, I wasn't sure if it was ALL doctypes that would break the code, or just specifically the one they were using. Thanks for clarifying.
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  7. #7
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Try to display that input element as block level element. See if adding the highlighted helps:
    Code:
    <input type="submit" name="registry" value="WTF" onmouseover="this.style.textDecoration = 'underline';" onmouseout="this.style.textDecoration = 'none';" style="display:block;" />
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  8. #8
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    Yep, I just tested that one rangana... it works in Fx LOL
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  9. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That's interesting, but making it display:block; will change how it lays out. If that's an issue, making it display:inline-block; appears to make it work as well, without changing how it lays out.

    Also, I did a little more testing. If it was a text input, there was no problem in the first place. If it was a button, instead of a submit button though, it was still the same problem.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #10
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Actually, if you just set a display property without even setting a value will make it work for firefox just like IE behaves:
    Code:
    <input type="submit" name="registry" value="WTF" onmouseover="this.style.textDecoration = 'underline';" onmouseout="this.style.textDecoration = 'none';" style="display:;" />
    Though it might fail CSS validation. (haven't tested)
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

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
  •