You now have a good idea of what XHTML is, and if you are still following the lessons, then I’m sure you will follow them to the end. In today’s lesson I will teach you how to put an email link into your webpage. Good luck!
If you publish your very first own website, then it’s probably really useful to know what other people think of it. If you want others opinions, then you could just put your email on one of your pages and that’s it. However, in XHTML you also have the option to put in a link, that will open an email-program and automatically put your email-address in the ‘To:’ box. You can read this post here to learn what you can expect from digging deeper into this. Such a link works almost the same as an External link, but instead of ‘http://’ you use ‘mailto:’. Such a link would look like this:
(a href=”mailto:email@example.com”)Clickable link(/a)I will explain every element in the address with this example address:
firstname.lastname@example.orgIn this email address ‘nobody’ is the username and ‘yahoo’ is the provider. The domain is the ‘.com’ which stands for ‘commercial’.
It’s also possible to put in a link that will send an email to more than one than one person. If you create the website together with a friend then it’s easier to put in a link that will send a mail to both of you, right? All you have to do, to accomplish this, is separate the two email-addresses with a ‘;’ symbol. It would look like this:
(a href=”mailto:email@example.com;firstname.lastname@example.org”)Clickable link(/a)To keep your email-inbox more structural, you could give every email send with that link, a standard subject. A great subject for the opinions of people about your website would be ‘comment’. When you put in that subject, the link would look like this:
(a href=”mailto:email@example.com;firstname.lastname@example.org ?subject=Comment”) Clickable link (/a)You expand the value after the ‘href’ with a ?subject=subjectsname, remember to put this after the email-addresses and not in front of it.
Open up your ‘index.html’ page your created before. At the bottom of this page, put an email link with your email and a subject. Make sure that when people would read your page now, they would know where to click, to contact you. There is no need to put in multiple email-addresses, but if you feel like you didn’t really understand it, then I encourage you to try it once. Good luck with the assignment and I hope to see you in the next lesson!