Font size
WorksheetsCSS Day-1
Total questions: 25
Worksheet time: 17mins
What does CSS stand for?
Color Style Sheets
Creative Style Sheets
Cascading Style Sheets
Computer Style Sheets
Which CSS is written directly inside an HTML element?
(a)
Where is Internal CSS written?
Inside <body>
Inside <style> tag in <head>
Inside an external file
Inside <style> tag in <script>
Which CSS type uses a separate .css file?
Inline
Internal
External
Embedded
What is the correct CSS syntax?
{body:color=black;}
body {color: black;}
body color: black;
body = color black;
A CSS rule starts with a (a) .
What is red in color: red;?
Property
Selector
Declaration
Value
Which is a correct grouping selector?
h1 h2 h3
h1, h2, h3
h1 > h2 > h3
h1 + h2
How many main combinator selectors are in CSS?
(a)
Which selector applies style to p inside div?
div + p
div > p
div p
div, p
What is a pseudo-class in CSS?
A class name starting with dot
A keyword added to selectors to define a special state
A JavaScript function
An HTML attribute
Which pseudo-class applies when the mouse is over an element?
(a)
What is the primary function of the CSS `::before` pseudo-element?
To change the style of an element when a user clicks on it.
To insert and style content immediately after an element's main content.
To style the first letter of an element's text content.
To insert and style content immediately before an element's main content.
Which pseudo-element styles the first letter of text?
::first-line
::before
::first-letter
::after
Which property is required with ::before and ::after?
color
display
content
position
Which pseudo-element styles placeholder text?
::input
::placeholder
::text
::value
What is the purpose of the `overflow: hidden;` property?
It adds scrollbars to the element, regardless of whether the content fits.
It clips any content that extends beyond the element's boundaries, making it invisible.
It allows the content to spill out and be visible outside the element's boundaries.
It adds scrollbars to the element only if the content is too large to fit.
Which combinator selector styles all `<p>` elements that are siblings of and appear after an `<h1>` element, regardless of whether they are immediately adjacent?
h1 > p
h1~p
h1`p
h1+p
Which property sets the space outside the element?
padding
margin
border
outline
In content-box, the width property applies to:
content only
content + padding
content + padding + border
total element width
Using border-box includes __________ in total element width.
content only
content + padding + border
margin only
padding only
Using content-box can cause layout issues when using (a) widths.
In CSS syntax, what is the term for the part of a rule that targets the HTML element to be styled, such as 'p' or '#header'?
(a)
Which overflow value hides overflowing content?
(a)
A box is defined with `width: 300px;`, `padding: 20px;`, and `border: 10px solid;`. If the `box-sizing` property is set to its default value, `content-box`, what will be the total calculated width of the box?
(a)
