HTML/CSS MCQs – Multiple Choice Questions and Answers – Part 10
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. How are custom fonts defined using CSS?
A @font-face
B It is not possible to define custom fonts.
C Using the src attribute.
D None of these answers
2. What will be the width of the div element below?
div { width: 310px; padding: 20px; border: 5px solid red; margin: 0; }
A 310px
B 350px
C 360px
D None of these answers
3. Which of the following properties is used to align text in CSS?
A text-align
B text-alignment
C text
D text-position
4. Which of the following approaches is correct for making a table responsive?
A overflow-x: auto
B overflow-x: none
C Both A and B
D None of these answers
5. What are the uses of CSS pseudo-elements?
A Style specific parts of an element.
B Style the first letter or line of an element.
C Insert content before or after the element.
D All answers are correct
6. How do you select elements with a specific attribute in CSS?
A Selector [attribute]
B Selector [property]
C Both A and B
D None of these answers
7. What is the parameter of the calc() function in CSS?
A A sentence
B A number
C A mathematical expression
D None of these answers
8. How do you give more importance to a property/value than normal?
A important
B !important
C strong
D blod
9. Which CSS property specifies the background painting area?
A background-size
B background-clip
C background-image
D background-color
10. Which function is used to insert the values of a CSS variable?
A var()
B varchar()
C rand()
D insert()