GIF | Only 256 colors. Mostly for logos and line art. Not suitable for photographs. Animation and transparency. |
---|---|
JPEG | Lossy compression (works really well for photographs but not for line-art and logos with sharp edges) |
PNG | Nonlossy and fullcolor. Use for non-photographic images instead of GIF. (GIF use historical/inertia). Transparency. |
src
attribute to specify the image file.
<img src="photo.jpg"> <img src="../photo.jpg"> <img src="http://www.reed.edu/assets_secondary/images/secondary_image_bgnd.jpg"> <img src="images/studentwork.jpg" alt="student work" height="100px" width="100px" align="right">
align
attribute for the <img>
tag has been dropped from HTML5 in favor of using CSS. Most browsers in use today still support this tag.
The alt
attribute of img
tag
<img src="photo.jpg" alt="photo of sunset"> <img src="buttonright.jpg" alt="right button"> <a href="go_right.html"> <img src="buttonright.jpg" alt="right button"> </a>
Note that the image serves as a link on the last example.
2001 | 2002 | 2003 | |
---|---|---|---|
First-Year | 355 | 314 | 301 |
Transfers | 43 | 33 | 30 |
<tr> | <td></td> | <th></th> | <th></th> | <th></th> | </tr> |
---|---|---|---|---|---|
<tr> | <th></th> | <td></td> | <td></td> | <td></td> | </tr> |
<tr> | <th></th> | <td></td> | <td></td> | <td></td> | </tr> |
<table> <caption>NEW STUDENTS (FALL)</caption> <tr> <td></td> <th>2001</th> <th>2002</th> <th>2003</th> </tr> <tr> <th>First-Year</th> <td>355</td> <td>314</td> <td>301</td> </tr> <tr> <th>Transfers</th> <td>43</td> <td>33</td> <td>30</td> </tr> </table>
You can change how the table looks (border width, color, alignment) using CSS. You may want to consult w3schools for advanced structuring of tables such as
Let's say you wanted to embed a video on youtube you found here:
http://www.youtube.com/watch?v=eU7V4GyEuXA
<iframe width="560" height="315" src="http://www.youtube.com/embed/eU7V4GyEuXA"
frameborder="0" allowfullscreen></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/eU7V4GyEuXA"
frameborder="0" allowfullscreen></iframe>
http:
before the server name. (This may be a bug). Use <iframe> to embed another document within the current document. Use CSS to change the width/height and the scrolling properties.
<iframe src="https://www.nyu.edu"> </iframe>
<iframe src="https://people.reed.edu/~miyos/F24/ILCP/ilcp_schedule_f24.html"> </iframe>
<iframe src="https://www.reed.edu"> </iframe>
<video src="great_video.mp4"> </video>
Sounds simple huh...
Using the source
element
<video> <source src="movie.webm" type="video/webm" > <source src="movie.ogg" type="video/ogg" > <source src="movie.mp4" type="video/mp4" > <p>This is fallback content</p> </video>If you want video control,
<video control> <source src="movie.webm" type="video/webm" > <source src="movie.ogg" type="video/ogg" > <source src="movie.mp4" type="video/mp4" > <p>This is fallback content</p> </video>If you want autoplay
<video autoplay> <source src="movie.webm" type="video/webm" > <source src="movie.ogg" type="video/ogg" > <source src="movie.mp4" type="video/mp4" > <p>This is fallback content</p> </video>