OA Exams
Which HTML element is used to create a hyperlink?
a) <link>b) <a>c) <href>d) <anchor>
Correct Answer: b) <a>
Explanation: The <a> element is used to create hyperlinks in HTML, allowing users to navigate to other web pages or resources.
What attribute is required to specify the URL of a hyperlink?
a) srcb) linkc) hrefd) alt
Correct Answer: c) href
Explanation: The href attribute specifies the destination URL for the hyperlink created by the <a> tag.
Which HTML5 element is used to create a table cell containing data?
a) <td>b) <th>c) <tr>d) <table>
Correct Answer: a) <td>
Explanation: The <td> element is used to define table cells that contain data in an HTML table.
Which tag is used to group table header, body, and footer content in HTML?
a) <tbody>b) <tfoot>c) <thead>d) All of the above
Correct Answer: d) All of the above
Explanation: The <thead>, <tbody>, and <tfoot> tags group content for the header, body, and footer sections of a table.
Which HTML element is used to define a block of navigation links?
a) <nav>b) <header>c) <section>d) <aside>
Correct Answer: a) <nav>
Explanation: The <nav> element defines a section of navigation links within a webpage.
Which attribute is used to associate a <label> with a form control?
a) forb) idc) named) value
Correct Answer: a) for
Explanation: The for attribute links a label with a form control by matching the id of the form control.
Which HTML attribute is used to specify an alternative text for images if the image fails to load?
a) titleb) srcc) altd) description
Correct Answer: c) alt
Explanation: The alt attribute provides alternative text for images, helping improve accessibility and SEO.
Which HTML element is used to group related form controls and labels?
a) <form>b) <fieldset>c) <section>d) <div>
Correct Answer: b) <fieldset>
Explanation: The <fieldset> element groups related form controls and their labels, often with a border around them.
Which tag is used to define an ordered list in HTML?
a) <ul>b) <ol>c) <li>d) <list>
Correct Answer: b) <ol>
Explanation: The <ol> tag is used to define an ordered (numbered) list, while <li> defines each list item.
What is the correct HTML element to define a paragraph?
a) <p>b) <para>c) <div>d) <section>
Correct Answer: a) <p>
Explanation: The <p> element defines a paragraph in HTML, used to separate blocks of text.
Which attribute specifies the media type (screen, print, etc.) in a <link> tag for stylesheets?
a) mediab) typec) reld) mode
Correct Answer: a) media
Explanation: The media attribute specifies which media type the linked stylesheet applies to, such as screen or print.
Which HTML tag is used to display a horizontal line across the page?
a) <line>b) <hr>c) <br>d) <border>
Correct Answer: b) <hr>
Explanation: The <hr> tag is used to create a horizontal rule or line to visually separate content.
Which tag is used to define a citation in HTML?
a) <cite>b) <q>c) <quote>d) <blockquote>
Correct Answer: a) <cite>
Explanation: The <cite> tag is used to reference the title of a work, such as a book or article.
Which HTML5 tag is used to embed an external resource like a webpage or a media player?
a) <embed>b) <iframe>c) <object>d) <media>
Correct Answer: b) <iframe>
Explanation: The <iframe> tag embeds external content, such as another webpage, into the current webpage.
Which CSS property is used to create space between the border of an element and its content?
a) marginb) paddingc) border-spacingd) outline
Correct Answer: b) padding
Explanation: The padding property creates space between the content of an element and its border.
What CSS property is used to hide an element from the webpage while maintaining its space?
a) visibilityb) displayc) opacityd) z-index
Correct Answer: a) visibility
Explanation: The visibility property hides the element from view but still maintains the element’s layout space.
Which CSS property is used to specify the amount of space between grid columns?
a) column-gapb) grid-gapc) grid-template-columnsd) padding
Correct Answer: a) column-gap
Explanation: The column-gap property defines the space between grid columns in a grid layout.
What is the default value for the CSS position property?
a) absoluteb) relativec) staticd) fixed
Correct Answer: c) static
Explanation: The default position value in CSS is static, meaning elements are positioned according to the normal document flow.
Which CSS property is used to change the color of text?
a) background-colorb) font-colorc) text-colord) color
Correct Answer: d) color
Explanation: The color property is used to set the text color in CSS.
Which CSS property controls the font size of text?
a) font-styleb) font-weightc) font-sized) text-size
Correct Answer: c) font-size
Explanation: The font-size property controls the size of the text.