HTML
HTML
b) HTML is the standard markup language mainly used to create web pages
c) HTML consists of a set of elements that helps the browser how to view the content
View Answer
Answer: d
Explanation: HTML is the standard markup language mainly used to create web pages. HTML describes
the structure and layout of a webpage. HTML consists of a series of elements that helps the browser
how to display content easily.
ADVERTISEMENT
ADVERTISEMENT
a) Rasmus Lerdorf
b) Tim Berners-Lee
c) Brendan Eich
d) Sergey Brin
View Answer
Answer: b
Explanation: Timothy John Berners-Lee (TimBL) is known as the father of HTML. He is a British computer
scientist, best known as the inventor of the World Wide Web.
View Answer
Answer: a
Explanation: HTML stands for “HyperText Markup Language”. HTML is the standard markup language
mainly used to design and create web pages and web applications.
a) </doctype html>
b) <doctype html>
c) <doctype html!>
d) <!doctype html>
View Answer
Answer: d
Explanation: The correct syntax of HTML5 doctype is <!doctype html>, doctype is the very first thing to
write in HTML5. <!doctype html> or <!DOCTYPE HTML> both are same because ‘doctype’ keyword is not
case sensitive.
5. Which of the following is used to read an HTML page and render it?
a) Web server
b) Web network
c) Web browser
d) Web matrix
View Answer
Answer: c
Explanation: A web browser (commonly referred to as a browser) is a software application for retrieving,
presenting and traversing information resources on the World Wide Web. A web server process, store
and display output to the client as per their request. Web matrix is a discontinued cloud-connected
website builder and HTML editor for Windows.
advertisement
c) Special characters must be escaped using character entities in XHTML unlike HTML
View Answer
Answer: a
Explanation: HTML is case insensitive while XHTML is case sensitive. In XHTML, special characters can be
escaped using character entites but not in HTML. Charset in HTML is “text/html” where as it is
“application/xml+xhtml” for XHTML.
7. Which of the following tag is used for inserting the largest heading in HTML?
a) head
b) <h1>
c) <h6>
d) heading
View Answer
Answer: b
Explanation: Headings in HTML starts from <h1> to <h6> in which <h1> heading is the largest one and
<h6> is smallest one among those. The heading tags are <h1> <h2> <h3> <h4> <h5> and <h6> that are
used for the creations of headings.
View Answer
Answer: d
a) head tag
b) title tag
c) html tag
d) body tag
View Answer
Answer: a
Explanation: Metadata is information about data. The meta tag provides metadata/meta information
about the HTML document. Metadata will not be displayed on the page. Metadata is present in head.
The body tag defines document’s body. A title tag is an HTML element which specifies the title of a web
page.
ADVERTISEMENT
ADVERTISEMENT
a) <u>
b) <mark>
c) <highlight>
d) <b>
View Answer
Answer: b
Explanation: The <mark> element is used to highlight a section of text. It is useful for quoting a text or if
one wants to bring attention to the text. The <b> tag is used to make text/paragraph bold. <u> tag is
used to underline the text you wanted.
a) <track>
b) <video>
c) <slider>
d) <source>
View Answer
Answer: c
Explanation: <video> tag is used to display video clips in HTML5. Multiple media resources for media
elements is specified by <source> tag. Text track for media elements i.e. <audio> & <video> is provided
by <track> tag in HTML5. There is no such thing as slider tag in HTML5.
a) </…….>
b) <!……>
c) </……/>
d) <…….!>
View Answer
Answer: b
Explanation: Browser ignores comment in a code. There are always two types of command i.e. single
line command and multiple line command. If one wants to add a comment in code, add the text
between these characters <!…..comment….>. It will not visible in the user’s browser.
advertisement
13. Which of the following elements in HTML5 defines video or movie content?
a) <video>
b) <movie>
c) <audio>
d) <media>
View Answer
Answer: a
Explanation: The media to which linked document is optimized is given by <media> tag. Before HTML5,
videos could only be played with a plug-in (like flash). The HTML5 video element specifies a standard
way to embed a video in a webpage. As like <video> elements, <audio> element contains additional files
or streams like music, recording, etc.
14. Which of the following is not the element associated with the HTML table layout?
a) alignment
b) color
c) size
d) spanning
View Answer
Answer: b
Explanation: There are three elements in HTML table layout i.e. size, spanning and alignment. Layout
type can be achieved by setting Rows elements layout attribute to Fixed or Auto. Auto attribute relies on
browser compatibility whereas fixed layout relies on developer specification.
a) CSS
b) jQuery
c) JavaScript
d) PHP
View Answer
Answer: a
Explanation: For styling HTML5, CSS i.e Cascading Style Sheet is used. It is style sheet language and
designed to describe presentation of its content including layouts, colors and fonts. CSS can control the
layout of multiple webpages.
16. Which HTML tag is used for making character appearance bold?
a) <u>content</u>
b) <b>content</b>
c) <br>content</br>
d) <i>content</i>
View Answer
Answer: b
Explanation: By enclosing words in the tags <b>and</b> we can make characters appear bold. <i>
element is for content in italics, <u> is for underlined content, <br> is for vertical breaking.
View Answer
Answer: c
Explanation: In HTML, <img> tag is used to insert an image in HTML page. Image tag has two attributes
(src and Alt).
–> Alt attribute is used to specify the alternate text for the image.
advertisement
a) SGMT
b) SGML
c) SGME
d) XHTML
View Answer
Answer: b
Explanation: HTML is a subset of SGML. SGML (Standard Generalized Markup Language) is a standard for
specifying a document markup language or tag set.
b) !
c) /
d) \
View Answer
Answer: c
Explanation: The forward-slash (/) is used to indicate the closure of a tag within HTML.
20. Which of the following HTML code will make an image clickable?
a)
b)
<img src="https://www.sanfoundry.com/sanfoundry-logo">
</img>
c)
d)
View Answer
Answer: d
Explanation: <a> tag defines a hyperlink, which is used to link from one page to another page. Suppose if
we want an image to be clickable then it should go inside <a> Tag.
a) <p>
b) <pre>
c) <hr>
d) <a>
View Answer
Answer: a
22. In HTML, which attribute is used to create a link that opens in a new window tab?
a) src=”_blank”
b) alt=”_blank”
c) target=”_self”
d) target=”_blank”
View Answer
Answer: d
Explanation: Add the target=”_blank” attribute in the Anchor tag. target=”_blank” attribute makes a link
open in a new window tab.
a) <em>
b) <abbr>
c) <q>
d) <blockquote>
View Answer
Answer: c
Explanation: <em> element indicates emphasis, browser will show the contents of <em> element in
italic. A section which is quoted from another source is specified by <blockquote>. The <abbr> defines
abbreviation. We used <q> element for shorter quote. Browser put quote around <q> element.
24. Which of the following HTML tag is used to create an unordered list?
a) <ol>
b) <ul>
c) <li>
d) <ll>
View Answer
Answer: b
Explanation: <ul> tag is used to create the unordered list items in an HTML document. By default,
unordered list items will display in a bulleted format.
Disc
Circle
Square
None
Syntax: <ul> Unordered List Items </ul>
a) <abbr>
b) <blockquote>
c) <q>
d) <em>
View Answer
Answer: a
Explanation: <em> element indicates emphasis, browser will show the contents of <em> element in
italic. We used <q> element for shorter quote. Browser put quote around <q> element. A section which
is quoted from another source is specified by <blockquote>. For using, abbreviation or acronym <abbr>
element is helpful. A title element is to be used with abbr.
26. Which of the following HTML tag is used to add a row in a table?
a) <th>
b) <td>
c) <tr>
d) <tt>
View Answer
Answer: c
Explanation: In HTML, <tr> tag is used to create a row in the table. <th> tag is used to set the header cell
of a table.
27. What is the work of <address> element in HTML5?
a) contains IP address
c) contains url
View Answer
Answer: d
Explanation: The contact details for author of a page is specified by <address> attribute. The content is
often displayed in italics,
e.g.
<address>
<a href="mailto:enquiry@sanfoundry.com">Sanfoundry</a>
</address>
Output:
Sanfoundry
28. Which of the following tag is used to create a text area in HTML Form?
a) <textarea> </textarea>
b) <text></text>
View Answer
Answer: a
Explanation: The text area tag (<textarea>) is used in a form to declare a text area element. It allows the
user to enter text in multiple rows.
a) <del>
b) <em>
c) <strong>
d) <ins>
View Answer
Answer: a
Explanation: <strong> element shows the importance of text/paragraph between it’s tags. <em>
element indicates emphasis, browser will show the contents of <em> element in italic. <ins> element
shows the content that has been inserted, usually it has underline. <del> element shows text that has
been deleted from, usually it has a line through the content.
a) port://domain.filenmae:path/scheme/prefix
b) prefix://scheme.port:domain/filename/path
c) path://prefix.port:domain/filename/scheme
d) scheme://prefix.domain:port/path/filename
View Answer
Answer: d
a) <input>
b) <select>
c) <text>
d) <textarea>
View Answer
Answer: b
Explanation: <select> element is used to create a drop-down list in HTML Forms. It is mainly used to
collect user input. Option tags are used within the <select> element to define available options from the
drop-down list.
a) <ol>
b) <ul>
c) <li>
d) <ll>
View Answer
Answer: a
Explanation: <ol> tag is used to create the numbered list or ordered list items in an HTML document. An
ordered list can be numerical or alphabetical order. <li> tag is used to define each list item.
a) <input type=”text”>
b) <input type=”textarea”>
c) <input type=”checkbox”>
d) <input type=”button”>
View Answer
Answer: c
Explanation: <input type=”checkbox”> is used to create a checkbox in HTML Form. Checkboxes allow a
user to select one or more options of a limited number of choices.
a)
b)
c)
d)
<a>https://www.sanfoundry.com/1000-html-questions-answers/</a>
View Answer
Answer: a
Explanation: An anchor tag (<a>) and href attribute are used to create a hyperlink in HTML.
a) .hl
b) .h
c) .htl
d) .html
View Answer
Answer: d
Explanation: .html or .htm extensions are used to save the HTML file.
a) <b>
b) <br>
c) <em>
d) <a>
View Answer
Answer: b
Explanation: In HTML, <br> tag is used to create a blank line. <b> tag is used to specify the bold text.
<em> tag is used to define the emphasized text.
37. Which HTML tag is used to convert the plain text into italic format?
a) <b>
b) <p>
c) <i>
d) <a>
View Answer
Answer: c
Explanation: In HTML, <i> tag is used to convert the plain text into italic format.
View Answer
Answer: d
Explanation: To create a break between themes-such as a change of topic in a book or a new scene in a
play-you can add a horizontal rule between sections using <hr/> tag
a) frameborder
b) width
c) height
d) src
View Answer
Answer: a
Explanation: An iframe is equivalent to a window that has been cut into our page, it is created using
<iframe> element. Src, height, width attribute are essentially used inside of this. Src attribute specifies
the URL of the page which is to be shown. Height and width specify the height and width of an iframe in
pixels.
a) <blockquote>
b) <strong>
c) <em>
d) <i>
View Answer
Answer: b
Explanation: The words are written inside <strong> can be said with strong emphasis. Browser shows
contents written inside <strong> element in bold.
Example:
a) <p>
b) <u>
c) <i>
d) <ul>
View Answer
Answer: b
Explanation: In HTML, underline tag (<u>) is used to display the underlined text.
42. Which attribute specifies a unique alphanumeric identifier to be associated with an element?
a) type
b) article
c) id
d) class
View Answer
Answer: c
Explanation: HTML is Hyper Text Markup Language that is used to create web pages and applications.
The id attribute is most used to point to a style in a style sheet, and by JavaScript (via the HTML DOM) to
manipulate the element with the specific id. Class is a name given to HTML elements that can be used by
CSS and JavaScript for styling web pages. A self-contained content is called an attribute.
43. Which of the following is an HTML specification used to add more information to HTML tags?
a) Modifydata
b) Minidata
c) Macrodata
d) Microdata
View Answer
Answer: d
Explanation: The Microdata spec provides a standardized syntax for additional semantic markup to your
web pages to enhance the machine readability of your web pages. The planning for distribution center
operation is offered by minidata. Macrodata and Modifydata are not any terms related to HTML5.
a) <samp>
b) <small>
c) <frame>
d) <iframe>
View Answer
Answer: d
Explanation: We can host our videos through YouTube and can easily embed them into our website.
<iframe> tag will be used for YouTube videos.
45. Which of the following HTML element is used for canvas graphics?
a) <css>
b) <paint>
c) <canvas>
d) <graphic>
View Answer
Answer: c
Explanation: CSS i.e. Cascading Style Sheet is a scripting language. Canvas graphics are introduced in
HTML5. Element used for canvas graphics is <canvas>. The HTML canvas element is used to draw
graphics, on the fly, via scripting (usually JavaScript).
tion