HTML/CSS MCQ

HTML/CSS MCQs – Multiple Choice Questions and Answers – Part 35

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 CSS property gives a 3D perspective to an element?

A perspective

B transform-style

C transform-perspective

D 3d-perspective

A
The perspective property adds a 3D perspective effect to an element, creating a sense of depth. For example, perspective: 500px; adds a 3D view to the element. See a full example.
 

2. Which HTML tag allows you to embed a JavaScript file into a page and run animations?

A <script src="animation.js"></script>

B <js src="animation.js">

C <script type="text/javascript">

D <animate src="animation.js"></animate>

A
The <script> tag with the src attribute allows you to embed an external JavaScript file into an HTML page. This file can contain animations and other interactive behaviors.
 

3. How do you create a radial gradient from blue to transparent in CSS?

A background: radial-gradient(blue, transparent);

B background: radial-gradient(transparent, blue);

C background-image: radial-gradient(blue, rgba(0,0,0,0));

D background: radial-gradient(blue to transparent);

A
The radial-gradient(blue, transparent) function creates a radial gradient from blue to transparent, offering a nice fade effect. See a full example.
 
 

4. Which CSS property makes an element circular with borders?

A circle-radius: 50%;

B border: circle;

C shape: circle;

D border-radius: 50%;

D
The border-radius: 50%; property transforms an element into a circle or ellipse by rounding its corners to 50% of its width and height. See a full example.
 

5. Which Flexbox property equally distributes remaining space between container elements?

A justify-content: space-evenly;

B justify-content: space-between;

C justify-items: space-evenly;

D align-items: center;

A
justify-content: space-evenly; distributes space evenly between elements, including space before the first and after the last item. See a full example.
 

6. Which HTML tag is used to group form elements into a logical section?

A <group>

B <fieldset>

C <form-section>

D <block>

B
The <fieldset> tag is used to group form elements and apply styles or logical structure to them. It can also display a border around the grouped elements.
 
 

7. Which HTML tag is used to embed a Google map on a page?

A <iframe src="https://www.google.com/maps/embed?..."></iframe>

B <google-map src="..."></google-map>

C <map src="https://maps.google.com">

D <embed src="https://maps.google.com">

A
The <iframe> tag is used to embed external content, such as a Google map, using a specific embed URL provided by Google.
 

8. Which CSS effect creates a parallax scroll, where the background moves at a different speed than the content?

A background-attachment: fixed;

B background-position: scroll;

C transform: translateZ(1px);

D background-repeat: no-repeat;

A
The background-attachment: fixed; property creates a parallax effect where the background image stays fixed as the page scrolls.
 

9. Which HTML tag allows you to create a custom numbered list using images instead of numbers?

A <ol style="list-style-image: url('image.png');">

B <ul style="list-style-image: url('image.png');">

C <ol type="image">

D <ol style="counter-style: image('image.png');">

A
The style="list-style-image: url('image.png');" attribute customizes the numbers of an ordered list <ol> using an image as the bullet or number.
 
 

10. Which CSS property allows you to continuously animate a 360-degree rotation?

A transform: rotate(360deg);

B @keyframes rotate { transform: rotate(360deg); }

C

@keyframes rotate { 
   from { 
     transform: rotate(0deg); 
   } to { 
     transform: rotate(360deg); 
   } 
}

D @rotate { animation: 360deg infinite; }

C
To animate a 360-degree rotation, use a CSS animation defined with @keyframes that specifies the transformation from 0° to 360°. See a full example.
mcqMCQPractice competitive and technical Multiple Choice Questions and Answers (MCQs) with simple and logical explanations to prepare for tests and interviews.Read More

Leave a Reply

Your email address will not be published. Required fields are marked *