HTML Revision Notes
Example 1:
Attaching the style sheet SAMPLE.CSS to the web page.
Place the following code inside the head <head> tags.
<link rel="stylesheet" type="text/css" href= "SAMPLE.CSS" >
Example 2:
Create a hyperlink from text CIE Exams to the webpage CAMBRIDGE.HTML, that will open in a new window called _circular
<a href= "CAMBRIDGE.HTM" target = "_circular"> CIE Exams </a>
The target attribute can take the following values:
_blank | Opens the linked document in a new window or tab |
_self | Opens the linked document in the same frame as it was clicked (this is the default) |
_parent | Opens the linked document in the parent frame |
_top | Opens the linked document in the full body of the window |
_framename | Opens the linked document in a named frame |
Example 3:
Insert the image blackcat.jpg and resize it to 200 pixels wide and 100 pixels high.
<img src = "blackcat.jpg" width = 200px height = 100px>
Example 4:
Insert the image blackcat.jpg and resize it to 200 pixels wide maintaining aspect ratio.
<img src = "blackcat.jpg" width = 200px >
(Maintain aspect ratio: ignore the other dimension)
Example 5:
Again, make the above image as a hyperlink that points to the website http://www.wildcats.com that opens in a new window called cats
<a href= "http://www.wildcats.com" target = "_cats" > <img src= "blackcat.jpg" width=100px> </a>
Example 6:
Make the text mail me a hyperlink to send an email to the address This email address is being protected from spambots. You need JavaScript enabled to view it. with a subject line Application developer
<a href="mailto:This email address is being protected from spambots. You need JavaScript enabled to view it.?subject=Application%20Developer"> mail me </a>
(Spaces between the words in the subject should be replaced by %20 to ensure that the browser will display the text properly)
Example 7:
Create an anchor called start. This must be invisible in the browser.
<a name = "start" > </a>
Example 8:
Make the text Go to start a hyperlink that will point to the anchor created in the above example: