ICT - Exploring HTML5 Q and A
ICT - Exploring HTML5 Q and A
Answer: Web pages can be created and modified by using professional HTML editors
like Notepad and TextEdit.
Answer: HTML files created in notepad should be saved with .html extension.
8. Question: What attribute is needed to display an image using the <img> tag?
Answer: To display an image using the <img> tag, you need to use the src attribute.
Answer: src stands for the source value of the src attribute.
Answer: The src attribute specifies the location of the image to be displayed on a
webpage.
11.Question: What attribute specifies an alternate text for an image?
Answer: The <center> tag is used to align text or images in the center.
Answer: The HTML <marquee> tag defines a moving piece of text or image in the
HTML document.
14.Question: Which direction will text found within the <marquee> tag scroll by default?
Answer: By default, text found within the <marquee> tag will scroll from right to left.
15.Question: What attribute of the marquee tag is used to change the type of scrolling?
Answer: The behavior attribute of the marquee tag is used to change the type of
scrolling.
Answer: Tables are divided into rows using the <tr> tag and columns using the <td>
tag.
Answer: A hyperlink is a text or image which connects a web page to another web page
or another part of the same web page.
25.Question: What attribute of the <a> tag specifies the location to which the created
hyperlink will be linked?
Answer: The href attribute of the <a> tag specifies the location to which the created
hyperlink will be linked.
Answer: CSS is used to manage the presentation part of the web page.
10 Two-to-Three Line Questions and Answers
1. Question: How do images improve a webpage, and how are they added in HTML?
Answer: Images can improve the design and appearance of a webpage. In HTML,
images are added with the <img> tag. To display an image, the src attribute, which
specifies the URL of the image, is needed.
2. Question: What is the purpose of the alt attribute in the <img> tag, and when is it
useful?
Answer: The alt attribute specifies an alternate text for an image, which is displayed if
the user cannot view the image. This is useful if the image is not loading or for users who
have images disabled.
3. Question: Explain the use of the <center> tag in HTML. What does it do, and when is
it useful to use this tag?
Answer: The <center> tag is used to center-align the text or images. It is useful when
there is a need to align an image in the center.
4. Question: What is the HTML <marquee> tag, and what does it do to the text or image
within it?
Answer: The HTML <marquee> tag defines a moving piece of text or image in the
HTML document that scrolls across the page in a vertical or horizontal direction
depending on the settings. By default, text found within the <marquee> tag will scroll
from right to left.
5. Question: Explain the purpose of subscript and superscript tags. Provide examples of
when each tag might be used.
Answer: The <sub> tag defines subscript text, which appears in a smaller size below
the normal line. For example, H2O uses subscript. The <sup> tag defines superscript
text, which appears smaller in size above the normal line, as in mathematical formulas
like x2 + y2 = 0.
6. Question: How are tables created in HTML, and what are the main tags used in the
table structure?
Answer: In HTML, tables are created using the <table> tag. Tables are divided into
rows and columns using the <tr> and <td> tags, respectively. The <th> tag is used to
create table headers, and the <caption> tag defines a table caption.
7. Question: What is the purpose of hyperlinks in web pages? Explain how hyperlinks are
created in HTML.
Answer: Hyperlinks allow users to click their way from page to page. In HTML,
hyperlinks are created using the anchor tag <a>. The href attribute of the <a> tag
specifies the location to which the created hyperlink will be linked.
Answer: The three types of hyperlinks include links to connect two web pages, links to
connect two sections of the same web page, and website links and email links.
9. Question: Explain what CSS is and its primary function in web development.
Answer: CSS stands for Cascading Style Sheets. Its main benefit is that it can change
the look and feel of all the web pages of a website by changing the content of just one
single .css file. CSS is used to manage the presentation part of the web page.
Answer: The three parts of CSS are selector, property, and value. Selectors are
elements to be modified, properties are elements whose property is to be modified, and
value changes the property according to the given value.
Answer: HTML (Hypertext Markup Language) is a markup language used to create web
pages. The basic structure of an HTML document consists of a series of elements,
including tags and attributes. Tags are commands that define different parts of the
webpage, such as headings, paragraphs, and images. Attributes provide additional
information about HTML elements; for example, the src attribute in the <img> tag
specifies the source URL of an image. Browsers read these tags to render the content of
the page. HTML files should be saved with a .html extension.
2. Question: Describe how to insert images into an HTML document, detailing the
attributes that can be used to control the appearance and behavior of images on the
page.
Answer: Images can be inserted into an HTML document using the <img> tag. The src
attribute is essential as it specifies the source URL of the image. Additional attributes
can be used to control the appearance and behavior of the image. The alt attribute
provides alternate text if the image cannot be displayed. The width and height attributes
define the width and height of the image in pixels. The border attribute sets the border
thickness around the image.
3. Question: What is the marquee tag in HTML, and how can its attributes be used to
modify the scrolling behavior, direction, and appearance of the text or image?
Answer: The HTML <marquee> tag is used to create a scrolling text or image on a
webpage. By default, the text scrolls from right to left. Several attributes can modify its
behavior. The behavior attribute defines the type of scrolling (e.g., scroll, slide, alternate).
The bgcolor attribute defines the background color of the marquee. The direction
attribute specifies the direction of scrolling (up, down, left, right). The height and width
attributes set the height and width of the marquee. The loop attribute specifies the
number of times the marquee loops.
4. Question: How are tables created in HTML, and what attributes can be used to format
and structure the table and its contents effectively?
Answer: Tables in HTML are created using the <table> tag, which organizes data in
rows and columns. Rows are created using the <tr> tag, table headers are created
using the <th> tag, and individual data cells are created using the <td> tag. The
<caption> tag defines a table caption. Attributes like align, bgcolor, border, cellspacing,
cell padding, width, and height can be used to format and structure the table.
Cellspacing is the space between cells, and cell padding is the space between the cell
border and its contents.
5. Question: Explain how hyperlinks work in HTML, detailing the different types of links
that can be created and the attributes used to specify the link's destination and behavior.
Answer: Hyperlinks in HTML are used to link web pages to other pages, sections within
the same page, or external resources. The <a> tag is used to create hyperlinks. The href
attribute specifies the destination of the link. There are three types of hyperlinks: links to
connect two web pages, links to connect two sections of the same web page, and
website links and email links. To link to a specific part of a webpage, you can use the <a
id="name"> tag to mark the section and then create a link to it using <a
href="#name">. For email links, you can use <a href="mailto:email
address">.
6. Question: What are Cascading Style Sheets (CSS), and how are they used to control
the presentation and layout of HTML elements on a webpage?
Answer: CSS (Cascading Style Sheets) is used to control the presentation and layout of
HTML elements on a webpage. CSS is used to manage the presentation part of the web
page. CSS describes how HTML elements are to be displayed on screen. CSS can be
added to HTML in three ways: Inline, Internal and External.
7. Question: Explain the differences between inline, internal, and external CSS, and
provide examples of when each approach might be most appropriate.
Answer: There are three ways to add CSS to HTML: inline, internal, and external. Inline
CSS is applied directly within HTML elements using the style attribute. Internal CSS is
defined within a <style> element in the <head> section of an HTML page. External
CSS uses an external .css file linked in the <head> section. Inline CSS is suitable for
applying unique styles to individual elements. Internal CSS is useful for styling a single
HTML page. External CSS is best for styling multiple pages consistently across an entire
website.
8. Question: How can the <div> and <span> tags be used to group and style HTML
elements, and what are the key differences between these two tags?
Answer: The <div> and <span> tags are used to group and style HTML elements, but
this source does not provide details on these tags.
9. Question: What are HTML frames, and how can they be used to divide a browser
window into multiple independent sections, each displaying a separate HTML
document?
Answer: HTML frames are used to divide a browser window into multiple sections, each
displaying a separate HTML document. The <frameset> tag defines the group of
frames, and the <frame> tag defines each individual frame within the frameset. The
cols and rows attributes of the <frameset> tag specify the layout of the frames in
columns or rows. The src attribute of the <frame> tag indicates the file to be displayed
in the frame.
10.Question: Describe the purpose and usage of HTML forms, including the various input
types and attributes that can be used to create interactive forms for collecting user data.
Answer: In HTML, tables are used to present data in a tabular form using the <table>
tag. Tables are divided into rows and columns using the < tr>, <th>, and <td> tags.
Tables can contain various types of information, including numbers, text elements,
images, and multimedia objects. You can set a border for a table using the border
attribute. For example: <table border=2>. Also, tables can be used to organize
calendars, schedules, statistics, or other types of information.
● Link to connect two web pages. For this type of link, the address and location of a
webpage that you want to link to has to be specified. The syntax is: <A href =
"filename.html"> text </A>.
● Link to connect two sections of the same webpage. To link to two sections of the
same webpage, the sections have to be marked with some name using the name
attribute. The syntax is: <A id = "#name"></A>. Then a hyperlink can be created
to the created name from any other part of the webpage as follows: <A href=
"#name"> Text </A>.
● Website links and email links. To link to a page to a website, the URL of the
website is specified with the href attribute. The syntax is: <A href = "URL of the
web page"> Text </A>. To link to an email compose box, the following syntax is
used: <A href = "mailto: email address> text </A>.
13. Question: What Are CSS? Describe the different parts of CSS.
Answer: CSS stands for Cascading Style Sheets. CSS is used to manage the
presentation part of a webpage. The main benefit of CSS is that it allows for changing
the look and feel of a website by adjusting just one single .css file. CSS describes how
HTML elements are to be displayed on a screen, saving a lot of work, and can control
the layout of multiple webpages all at once.
Answer: Frames divide a browser window into several pieces or panes, each containing
a separate HTML document. The <frame> tag defines one particular window (frame)
within a <frameset> tag. A webpage can be divided into columns or rows using cols or
rows attributes of a <frameset> tag respectively.
<frameset cols="25%,*,25%">
<frame src="Frame_A.htm">
<frame src="Frame_B.htm">
<frame src="Frame_C.htm">
</frameset>
Answer: The alt attribute displays alternate text for an image if the user cannot view it.
Answer: No, not all HTML tags come in a pair. The <frame> tag is always an empty
tag and therefore should not have any content. Also, the <img> tag is an empty tag.
Answer:
Here are the key differences between Internal CSS and External CSS, according to the
sources:
Internal CSS:
Answer: Here are the key differences between Cellspacing and Cellpadding in HTML
tables:
Answer: Here are the key differences between the < tr> and <td> tags: