WDI Fundamentals Unit 2
In this exercise, you'll write your first hyperlinks: Those magical, clickable links that get you from one place to another on the web.
When complete, your output should look like this:
If you don't see the JS Bin below, please refresh the page.
Use the editor provided below to write your code and see what renders!
1) Give your website some content: Introduce yourself, mention a social media account (or a website of your choosing), and ask for users to send you an email. Try something like this:
Hi, I'm awesome.
Follow me on Twitter.
Send me an email.
2) Wrap the first line, "Hi, I'm awesome." in
3) Wrap the rest of your content with
p tags. You'll want to use the paragraph tag on both the second and third line. HTML tags are reusable, so you can use as many of each kind as you need.
4) Wrap the text, "Follow me," in an anchor element (with
5) The opening
a tag needs a hyperlink reference attribute (
href) so it knows where to go when clicked. Go ahead and link to your Twitter page (or whichever website you chose).
<a href="http://twitter.com/GA">Follow me</a> on twitter.
Sometimes you won't know which link destination you want until you've finished coding your site. In those cases, you can substitute a hash symbol as a placeholder, like so:
Send me an <a href="#">email</a>.
6) Now, wrap an empty
a tag around the word "email" on the second line.
mailto: in front of your email address so the browser knows it's not a web page.
Send me an <a href="mailto:email@example.com"> email </a>.
HTML pays attention to spaces between tags. Only words should be hyperlinked, not spaces or punctuation.
8) Click on the OUTPUT button to see what your HTML code renders.
Make sure you have:
<h1>tag and a closing
You can do a lot of neat things using attributes and links. Let's keep going!