HTML elements Flashcards
On a web page, the content is shown in a block of text without any spacing between paragraphs. What two HTML elements would you use from the following to create space between paragraphs?
‹p›, ‹br /›
The following text is from a client’s page
Progressing Interest by Fion Lim First a gentle hug
Next a soft peck on cheeks
Then a kiss on the lips
On three separate dates
Signaling your romantic intent
The client wants to add a horizontal line between the title and the text. How would you do this using only one HTML element?
Progressing Interest by Fion Lim‹hr /›
Your client contacts you about adding a map to their website. However, they do not want to use Google Maps or Bing Maps, but to use a satellite picture of a certain area, and want the website visitors to be able to click on specific parts of the picture. How can you achieve this using only HTML elements, without any scripting?
In the ‹img› tag for the picture, the usemap attribute will be used to reference a ‹map› tag that can be used to make different parts of the picture clickable.
Visitors to a certain website may be using old browsers with scripting disabled. What HTML element would you use to show an appropriate message while still allowing scripting for the visitors using modern browsers?
‹noscript›
In a paragraph, sections of the text need to be colored differently than the rest. What HTML element would you use to wrap these sections to apply styling?
‹span›
The following list is provided to you by your website’s client:
Oranges Apples Grapes

Bananas
Mangoes
Your client wants you to make a bulleted list of these items. Show how you would achieve this?
‹ul› ‹li›Oranges‹/li› ‹li›Apples‹/li› ‹li›Grapes‹/li› ‹li›Bananas‹/li› ‹li›Mangoes‹/li› ‹/ul›
What HTML element is useful for creating an ordered and numbered list for the following items? One, Two, Three, Four, Five
‹ol›
On a programming website, the author wishes to show HTML codes as examples. What HTML element is best for wrapping these code samples?
‹code›
Suppose you are developing a website for a chemistry course. How would you show the Oxygen gas symbol, O2, on a web page?
O‹sub›2‹/sub›
A mathematics instructor contacts you to find out how to code the equation given below using HTML only. What would your response be? x(squared)
f(x) = x2 – 2x + 1
f(x) = x‹sup›2‹/sup› - 2x + 1
For the sake of easy maintenance, your website’s styles are in a .css file, so that it can be used in multiple pages. What HTML element and attribute are used to specify an external stylesheet?
‹link rel=”stylesheet” type=”text/css” href=”theme.css”›
On the contact page, an email address is shown. How would you create an email link that opens the default email client to compose a new message to someone@somesite.com?
‹a href=”mailto:someone@somesite.com“›
A lengthy web page “mypage.htm” contains various headings. How would you create a link to this web page so that a specific heading at the bottom of the page, “Credits”, comes into view when your link is clicked?
First, create a bookmark the bottom heading, ‹a name=”credits”›Credits‹/a›. Then, the link will be constructed as ‹a href=”mypage.htm#credits”›Open Credits page‹/a›
On a web page, there are various images. However, for text-based browsers, there is
a need to show alternative text-only. What HTML attribute would you use in order to display alternative text when the image is not available?
alt
A web page contains many one-line sentences followed by a “Click me” button. However, in order to assist the site user, there is need to create tooltips for each “Click me” button. What HTML attribute, when set, allows browsers to show a tooltip? Answer:
title
On a web page, whenever a key is pressed, the page would refresh. What HTML events would be useful in this scenario?
onkeypress, onkeydown, onkeyup
On a certain website, whenever the mouse is moved over an image, the image should change to another colored version. Also, when the mouse moves away from the image, it should return to its default picture. Which HTML events can be used to cause this change to happen?
onmouseover will be used to change the image when it gets focus, while onmouseout would be used to revert back to the default.
On a web page, a mock image looks like a button. However, the image does not behave like a button when clicked. Which HTML event would you use to make the image button clickable?
onclick