HTML/CSS MCQs – Multiple Choice Questions and Answers – Part 9
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. The CSS property used to specify the transparency of an element is ________.
A opacity
B visibility
C filter
D None of these answers
2. What is the correct syntax to link an external CSS file?
A <link rel="stylesheet" type="text/css" href="style.css">
B <link rel="stylesheet" type="text/css" src="style.css">
C <style rel="stylesheet" type="text/css" href="style.css">
D <style rel="stylesheet" type="text/css" src="style.css">
3. Which of the following methods are valid for representing a color in CSS?
A A valid color name
B RGB values
C HEX values
D All answers are correct
4. Which of the following methods selects all h1 headers inside a div element?
A div h1
B div.h1
C h1
D div-h1
5. Which CSS property is used to create rounded borders around elements?
A border-collapse
B border-round
C border-radius
D None of these answers
6. How do you set the maximum width of a content box using CSS?
A The height property
B The max-height property
C The max-width property
D None of these answers
7. Which CSS property is used to specify different border styles?
A border-style
B border
C Both A and B
D None of these answers
8. Which of the following are valid values for the position property in CSS?
A fixed
B relative
C static
D All answers are correct
9. What is the purpose of the inherit value for a property?
A Inherits the value from the parent element.
B Invalid property name.
C Changes the value of the parent element’s property.
D None of these answers
10. Which of the following CSS properties is used to control layout?
A display
B color
C text
D None of these answers