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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Feb 2014
    Posts
    153
    Thanks
    38
    Thanked 0 Times in 0 Posts

    Text underline question

    Hello

    Is there a reason, please, why this isn't underlining:

    Code:
    <font style="color: #ffff00;" text-decoration: underline;>info@mySite.com</font>
    The colour changes as required, but it does not underline?

    I also wondered if it's good practice to have email addresses as links? In my own particular case it's fine because MS Outlook opens up a new message for me to send, but it wouldn't if you had, say, a Yahoo! email even if you had your email account open.

    Thanks

    Blue1

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,725
    Thanks
    6
    Thanked 1,013 Times in 986 Posts
    First of all, don’t use <font>, that has been deprecated for, like, 15 years now. Then, look at that line of code again: the text decoration rule is outside of the style attribute.

    It doesn’t hurt to have e-mail addresses as links. If the user has an e-mail program configured it might open a new message (regardless of the address used), or it might not but it doesn’t matter. However, having plain e-mail addresses online is an invitation for spam bots to scrape that and for spammers to do what they are typically doing. A simple but fairly effective method is to encode the e-mail address as HTML entities (be sure to also encode the “mailto:” string).

  • Users who have thanked VIPStephan for this post:

    Blue1 (07-09-2014)

  • #3
    Regular Coder
    Join Date
    Feb 2014
    Posts
    153
    Thanks
    38
    Thanked 0 Times in 0 Posts
    Hello VIPStephan

    Thank you for your reply.

    I see what you mean: the second lot of inverted commas should come after the semi-colon after 'underline' and not after the colour?

    That's a useful tool, thank you. I'll give it a go!

    Blue

  • #4
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    <span style="color: #ffff00; text-decoration: underline;">info@mySite.com</span>
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • Users who have thanked felgall for this post:

    Blue1 (07-09-2014)

  • #5
    Regular Coder
    Join Date
    Feb 2014
    Posts
    153
    Thanks
    38
    Thanked 0 Times in 0 Posts
    Many thanks, Felgall - yes, that's what I have already.

    Some things must be improving!

    I'll work on encoding the email address, too.

    Thanks again.

    Blue1


  •  

    Posting Permissions

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