HTML/CSS MCQs – Multiple Choice Questions and Answers – Part 29
Multiple choice questions and answers (MCQs) on HTML/CSS to prepare for exams, tests, and certifications. These questions are taken from a real written exam and some parts are taken from an interview. So you will find questions on basic techniques such as tags, web standards, CSS selector, objects, and more. This quiz will easily prepare anyone to pass their online test.
1. Which HTML tag is used to display a PDF document in a web page?
A <pdf>
B <embed src="document.pdf">
C <object src="document.pdf">
D <iframe src="document.pdf">
2. How can you write a multi-line comment in HTML?
A <!-- Multi-line comment -->
B /* Multi-line comment */
C // Multi-line comment
D <!-- Multi-line comment
(no closing tag)
3. Which HTML tag is used to create an article section in a blog?
A <article>
B <section>
C <div>
D <aside>
4. What is the impact of excessive HTML comments on a page?
A Increases performance
B Does not affect performance
C Reduces performance by increasing the file size
D Blocks the execution of the code
5. What is the correct syntax to define a @keyframes animation that moves an element from left to right on the screen?
A @keyframes slide { from { left: 0; } to { left: 100%; } }
B @keyframes slide { from { position: left; } to { position: right; } }
C @keyframes slide { start { left: 0; } end { left: 100%; } }
D @keyframes slide { 0% { left: 0; } 100% { left: 100%; } }
6. Which CSS property is used to apply a filter to an image, such as blur or increased contrast?
A image-filter
B filter
C img-filter
D effect
7. Which HTML tag is used to merge two or more cells in a row of a table?
A <merge>
B <span>
C <td colspan="2">
D <cell merge="2">
8. Which CSS background-repeat value allows an image to repeat both horizontally and vertically?
A repeat-x
B repeat-y
C repeat
D no-repeat
9. How can you make a column of an HTML table sortable by the user?
A Use a JavaScript plugin to sort the columns.
B Add the sortable attribute to the <th> tags.
C Use a <sort> tag inside the table.
D It is not possible to make a table sortable in pure HTML.
10. What is the purpose of the <meta name="description" content="...">
tag in the <head> of an HTML page?
A Provide a description that will appear in the body of the page.
B Help search engines understand the content of the page.
C Define the ID of the page for SEO.
D Create a link to another page of the site.