html mcq
html mcq
1. All HTML documents must start with a document type declaration which is written as
________
a) <!DOCTYPE html>
b) <DOCTYPE html>
c) <!DOCTYPE >
d) </DOCTYPE html>
7. Which HTML tag is used to display the title of the document in the browser title bar?
a) <meta>
b) <title>
c) <head>
d) <header>
12. which attribute specifies the destination address of a hyperlink in an <a> tag?
a) link
b) href
c) src
d) target
23. The ________ tag of HTML is used for creating scrollable text or images.
a) <img>
b) <marquee>
c) <text>
d) <a>
30. The attribute of Marquee tag which controls the scrolling speed is ______.
a) scrollamount
b) speed
c) amount
d) scroll
3. What are HTML attributes, and how do they modify the behavior or appearance of
an HTML element?
Ans: HTML attributes are additional information included in an HTML tag that modify the
behavior or appearance of an element. For example, the href attribute in an <a> tag
specifies the URL of the link.
4. How does the <table> element work in HTML, and what are the roles of <tr>,
<td>, and <th> tags within it?
Answer: The <table> element in HTML is used to create a table with raws and columns.
The <tr> tag defines a table row, <td> defines a standard data cell within a row, and
<th> defines a header cell, which is typically bold and centered.
5. What are inline styles in HTML, and how do they differ from internal and external
stylesheets?
Ans: Inline styles are CSS styles applied directly to an HTML element using the style
attribute. Unlike internal styles (placed within a <style> tag in the <head>) or external
stylesheets (linked via a <link> tag). Inline styles only affect the specific element they are
applied to.