HTML and CSS Reference
In-Depth Information
img : it's not just relative links anymore
The src attribute can be used for more than just relative links; you can also put a URL in
your src attribute. Images are stored on web servers right alongside HTML pages, so every
image on the Web has its own URL, just like web pages do.
You'll generally want to use a URL for an image if you're pointing to an image at a different
website (remember, for links and images on the same site, it's better to use relative paths).
Here's how you link to an image using a URL:
<img src="">
The URL is the p ath to the image,
so the filename a t the end is always
the filename of a n image. There's
no such thing as a default image like
there is for web pages.
Here's a “Sharpen your pencil” that is actually about pencils (oh, and images too). This exercise
involves a bit of trivia: Given a typical, brand-new pencil, if you drew one continuous line with it,
using the entire pencil up, how long would the line be?
What's that got to do with images? To find the answer, you're going to have to write some HTML.
The answer to this trivia is contained in the image that is at the URL
hfhtmlcss/trivia/pencil.png. Your job is to add an image to this HTML and retrieve the answer:
<title> Sharpen your pencil trivia </title>
<p> How long a line can you draw with the typical pencil? </p>
Put your image elem ent here.
Search WWH ::

Custom Search