HTML/CSS MCQs – Multiple Choice Questions and Answers – Part 28
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 insert a line break?
A <break>
B <br>
C <hr>
D <newline>
2. Which HTML tag is used to define a main section of a page’s content?
A <main>
B <section>
C <div>
D <article>
3. What is the correct syntax to create a linear gradient from red to blue in CSS?
A background: linear-gradient(red, blue);
B background: gradient(linear, red, blue);
C background: linear-color(red to blue);
D background: color-gradient(red, blue);
4. Which HTML attribute tells the search engine that a page’s content should not be indexed?
A rel="nofollow"
B meta="noindex"
C <meta name="robots" content="noindex">
D <meta name="index" content="false">
5. Which HTML tag allows you to embed a Google Map in a webpage?
A <iframe>
B <map>
C <google-map>
D <embed>
6. Which CSS property is used to define a custom variable for an element’s color?
A --color: blue;
B var(--color, blue);
C color: var(--color);
D All of the above
7. Which HTML tag is used to include Google Fonts in a webpage?
A <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto">
B <style href="https://fonts.googleapis.com/css2?family=Roboto">
C <font-face src="https://fonts.googleapis.com/css2?family=Roboto">
D <link src="https://fonts.googleapis.com/css2?family=Roboto">
8. Which CSS property is used to apply a transformation to an element (e.g., rotation)?
A rotate
B move
C position-transform
D transform
9. Which HTML attribute is used to make an image responsive by adjusting its size to the screen?
A width="100%"
B srcset
C responsive="true"
D img-responsive
10. Which CSS property is used to create columns in a CSS Grid container?
A grid-template-columns
B grid-columns
C grid-columns-template
D column-layout