- You can submit your work from yesterday and today here.
- I have received the homework that was due yesterday from 12 of you.
- If you submitted your first web page yesterday, I sent you an email in response.
- If you didn't submit it, you received a zero. There is more work due at the end of class today and you're quickly falling behind.
- If you can get it in to me by the end of the period and it's good, I will give you half credit.
- If you can't get it in to me, I will not accept it after 9:52am today, February 5, 2013.
Basically, we are just going to take what we did yesterday and up the ante a bit. Text pages that don't go anywhere are great and wonderful, but they are ultimately missing the point of the web. A big part of the Hypertext Transfer Protocol (HTTP) and the Hypertext Markup Languange (HTML) is this idea of hyper text.
Hypertext sounds fancy, but it really isn't. You know those links you click on to get from one page to another? Those are hypertext. Single page web apps are rising in popularity, but if you are going to be writing software for the web, then you're going to need to learn how to link to other pages and sites.
Let's take a look at the code that would create a link to the Google homepage:
<a href="http://google.com">Google</a>
Alright, there are some new things going on here—but nothing that you should be unfamilar with if you've done your reading. First we have our tag element: <a></a>
. Inside of that element, we have the text we want to turn into a hyperlink. But inside of the opening tag, we added an attribute. An attribute is an extra piece of information. In this case the attribute href
(which stands for hyper-reference) is telling us where the link points to. You can also add a title to the link that will be shown to the user when they hover their mouse over it.
<a href="http://google.com" title="The Google Homepage">Google</a>
Please notice that you don't need to include these attributes in the closing tag, only the opening one.
Alright, let's take a look at another element: the <img>
. Images are a little funky because they don't have closing tags.
<img src="nyancat.gif">
Again, there is no </img>
tag. Also, just like the <a>
element, the <img>
needs a bit more information in order to work. We need to tell the element where the image is by setting the src
attribute. In this case, we're telling the <img>
element to look for a file called nyancat.gif
in the same folder at the HTML file we're working with. If it's in a different folder, it's not going to load. The number one reason why students complain that their pages don't work is because their images (or Javascript files or stylesheets) are in the wrong place.
We can also link to images elsewhere on the web.
<img src="http://f.cl.ly/items/2p270p1I2f1V1K1P1B2d/Screen%20Shot%202013-02-05%20at%208.52.04%20AM.png">
This is get a remote image and display it on the page. It is generally a terrible idea to link to images you don't control. if you link to an image on my page and I move it or delete it, your site breaks. That stinks.
- Create a page with all of the elements from yesterday's assignment
- This page should be about your favorite food and why you like it
- Link to the Wikipedia article on that food
- Include an image (it can be a remote image) to a photograph of your favorite food.
This is due at the end of the period and it is worth ten points.