I’m currently learning HTML CSS and am trying to implement a hyperlink to my work email.
My current line of code doesn’t have any problems I think but I don’t know how to add a email Hyperlink
This is my line of code and I see no issues even after inspecting it multiple times, and if it looks bad I’m sorry, first post here and I’m new to programming.
<Doctype html>
<head>Work Website</html>
<hr>
<body>
<p href= "[email protected]">Email me.</p>
</body>
4
Answers
This is basic HTML; instead of trying to apply the
href
attribute to thep
tag, you should be using thea
tag:This
<p>
tag is used for paragraphs. For links, you need to use an anchor with this tag<a>
.To create a hyperlink that allows users to email you, you need to use an tag with the mailto: scheme in the href attribute. Your current code uses a
tag, which is not meant for hyperlinks.
There are some issues with your code structure. The structure of your HTML code should be as follows:
<p>
tag is used for defining paragraphs. It cannot be used along with thehref
attribute.In order to create a hyperlink to link to other pages, email addresses etc. you need to use the
<a>
(anchor) tag along with thehref
attribute.You need to use the
mailto
parameter inside thehref
attribute to link to email addresses.This will work:
If you wish, you can also add it inside a paragraph like this: