CSS Multiple Choices
1. CSS Animation
Which of the following would create the below animation? Moving the mouse over the div should double its size, and the animation should happen over 500ms.
<style>
div {
height: 50px;
width: 50px;
background: #3ba59b;
border-radius: 50%;
}
</style>
<div class=”greyBall”></div>
2. CSS object-fit
Which of the following are true about the CSS property ‘object-fit’?
3. CSS Ellipsis
If an element extends beyond the allocated width, how do you truncate the sentence with an ellipsis (…) using CSS?
For example, “Hello! I am an element, and my width is larger than the container…”
4. CSS Text Coloring
Which of the following renders the text red?
<p id=”tagId”>Please color me red</p>
5. CSS Selection
How do you prevent the user from selecting the text rendered inside the following element?
<p>I should not be selectable</p>
6. CSS Input Placeholder
How do you hide the “placeholder” text of an <input> field?
Pick ONE OR MORE options
❌ input::placeholder{visibility:clip;}
✔️ input::placeholder{color: transparent;}
❌ input::placeholder{display: none;}
❌ input::placeholder{visibility:hidden};
7. CSS Centering
Which of the following options can position the div with the class name “child” exactly at the center of the page?
<div class=”parent” style=”width: 100vw; height: 100vh;”>
<div class=”child” style=” height: 100px; width: 100px; background: black”></div>
</div>
8. CSS vertical-align
Which of the following are true about the CSS property ‘vertical-align’?
<p>
Let’s
<span class=”heroWord”>Hack</span>
<img src=””/>
</p>