You are on page 1of 9

Question (1) How can you style paragraphs inside a <div> element

using the descendant selector?


 Purpose: Assess understanding of styling nested elements using CSS descendant
selectors.
Question (2) How do you style only the immediate children <li>
elements of an unordered list?
 Purpose: Test knowledge of styling specific child elements within a parent container.
Question (3) How can you style the first <p> element that directly
follows an <h2> element?
 Purpose: Assess understanding of styling elements based on their relationship with other
elements.
Question (4) How can you style all <p> elements that follow an <h2>
element, regardless of being adjacent or not?
 Purpose: Gauge knowledge of styling elements based on their relationship with other
elements without adjacency constraints.
Question (5) How can you style a link differently when it's being
hovered over by the mouse?
 Purpose: Test understanding of applying hover effects to links using CSS.
Question (6) How can you insert content before every <p> element
using a pseudo-element?
 Purpose: Assess understanding of using pseudo-elements to add content to HTML
elements.
Question (7) How can you add a decorative symbol after every <h3>
element?
 Purpose: Test knowledge of adding decorative content after specific HTML elements.
Question (8) How can you style the first letter of every paragraph
differently?
 Purpose: Assess understanding of styling specific text within elements using CSS.
Question (9) How can you style the text that gets selected by the
user?
 Purpose: Gauge knowledge of styling selected text using CSS.

1
Question (10) How can you style the placeholder text in an input
field?
 Purpose: Test understanding of styling placeholder text within input elements.
Question (11) How can you style all <a> elements with a target
attribute set to _blank?
 Purpose: Assess understanding of styling links with specific attributes using CSS.
Question (12) How can you style <input> elements with a type
attribute set to submit?
 Purpose: Test knowledge of styling input elements based on their type attribute.
Question (13) How can you style all elements with an href attribute
starting with "https://"?
 Purpose: Assess understanding of styling elements with specific attribute values using
CSS.
Question (14) How can you style all <img> elements with a src
attribute ending with ".png"?
 Purpose: Test knowledge of styling elements based on specific attribute values.
Question (15) How can you style all <a> elements with an href
attribute containing "example"?
 Purpose: Assess understanding of styling elements based on partial attribute values.
Question (16) How can you apply a solid red border with a width of 2
pixels to a <div> element?
 Purpose: Test knowledge of applying border styles to elements using CSS.
Question (17) How do you create a dashed border with a 3-pixel width
for the top border only?
 Purpose: Assess understanding of creating specific border styles for different sides of an
element.
Question (18) What's the syntax to set different styles for each side of
a border?
 Purpose: Gauge knowledge of syntax for setting border styles individually for each side of
an element.
Question (19) How can you create a border with rounded corners?
 Purpose: Test understanding of creating borders with rounded edges using CSS.
Question (20) How would you create a double border with different
colors for the inner and outer border?
 Purpose: Assess understanding of creating double borders with distinct styles using CSS.

2
Question (21) How can you set equal margins of 20 pixels for all sides
of an element?
 Purpose: Test knowledge of setting uniform margins for an element using CSS.
Question (22) What's the syntax for setting different margins for each
side of an element?
 Purpose: Assess understanding of setting margins individually for each side of an
element.
Question (23) How do you center an element horizontally using
margins?
 Purpose: Gauge knowledge of centering elements horizontally using CSS margins.
Question (24) What's the shorthand property for setting individual
margins for an element?
 Purpose: Test understanding of shorthand properties for setting margins in CSS.
Question (25) How would you collapse the top margin of a heading
with the bottom margin of a paragraph?
 Purpose: Assess understanding of collapsing margins between adjacent elements.
Question (26) How do you apply a padding of 15 pixels to all sides of a
<div> element?
 Purpose: Test knowledge of applying padding uniformly to an element using CSS.
Question (27) What's the syntax for setting different padding values
for each side of an element?
 Purpose: Assess understanding of setting padding individually for each side of an
element.
Question (28) How can you achieve equal padding on all sides of an
element using the shorthand property?
 Purpose: Gauge knowledge of shorthand properties for setting uniform padding in CSS.
Question (29) How do you remove all padding from an element?
 Purpose: Test understanding of removing padding from an element using CSS.
Question (30) What's the effect of negative padding on an element?
 Purpose: Assess understanding of the effect of negative padding values on element
layout.
Question (31) How can you set the height of a <div> element to be 200
pixels?
 Purpose: Test knowledge of setting the height of elements using CSS.
Question (32) What's the difference between setting height in pixels
versus percentage?

3
 Purpose: Assess understanding of differences between setting height in pixels versus
percentage.
Question (33) How do you make an element's height automatically
adjust to fit its content?
 Purpose: Test knowledge of making an element's height responsive to its content using
CSS.
Question (34) What happens if you set a negative height value for an
element?
 Purpose: Assess understanding of the effect of negative height values on element layout.
Question (35) How would you ensure that a <div> element always
takes up the full height of its container?
 Purpose: Test knowledge of ensuring full-height elements within their containers using
CSS.
Question (36) How can you set the width of a <div> element to be 300
pixels?
 Purpose: Assess understanding of setting the width of elements using CSS.
Question (37) What's the difference between setting width in pixels
versus percentage?
 Purpose: Test understanding of differences between setting width in pixels versus
percentage.
Question (38) How do you make an element's width automatically
adjust to fit its content?
 Purpose: Gauge knowledge of making an element's width responsive to its content using
CSS.
Question (39) How would you ensure that a <div> element always
takes up the full width of its container?
 Purpose: Test knowledge of ensuring full-width elements within their containers using
CSS.
Question (40) How can you set the text color of a paragraph to be
blue?
 Purpose: Assess understanding of setting text color using CSS.
Question (41) What's the property to make text bold in CSS?
 Purpose: Test knowledge of specifying font weight for text using CSS.
Question (42) How do you italicize text using CSS?
 Purpose: Gauge understanding of specifying font style for text using CSS.

4
Question (43) What's the shorthand property for setting font size,
family, and style together?
 Purpose: Assess understanding of shorthand properties for specifying font properties in
CSS.
Question (44) How can you align text to the center within its
containing element?
 Purpose: Test knowledge of aligning text horizontally using CSS.
Question (45) How can you set a background image using CSS?
 Purpose: Assess understanding of setting background images for elements using CSS.
Question (46) How can you create a gradient background in CSS?
 Purpose: Test knowledge of creating gradient backgrounds for elements using CSS.
Question (47) How can you set a fixed background image that doesn't
scroll with the content?
 Purpose: Assess understanding of fixing background images relative to the viewport using
CSS.
Question (48) How can you position a background image within its
container?
 Purpose: Test knowledge of positioning background images within element containers
using CSS.
Question (49) How can you repeat a background image only
horizontally?
 Purpose: Assess understanding of repeating background images along a single axis using
CSS.
Question (50) What are the components of the CSS box model?
 Purpose: Test knowledge of the conceptual components of the CSS box model.
Question (51) How can you make sure that an element's total width
includes padding and border, but not margin?
 Purpose: Assess understanding of the box-sizing property and its effect on element sizing
in CSS.
Question (52) How can you set different values of padding for all four
sides of an element?
 Purpose: Test knowledge of setting padding individually for each side of an element in
CSS.
Question (53) How can you create a box with rounded corners using
CSS?
 Purpose: Assess understanding of creating rounded corners for elements using CSS.

5
Question (54) How can you specify the width of an element excluding
padding and border?
 Purpose: Test knowledge of calculating the content width of elements in CSS.
Question (55) How can you add an outline to an element in CSS?
 Purpose: Assess understanding of adding outlines to elements for visual emphasis using
CSS.
Question (56) Can you specify different outline styles?
 Purpose: Test knowledge of specifying different outline styles for elements in CSS.
Question (57) How can you make sure the outline doesn't affect the
element's dimensions?
 Purpose: Assess understanding of controlling the impact of outlines on element layout in
CSS.
Question (58) Can you make the outline appear only on one side of the
element?
 Purpose: Test knowledge of specifying outline styles for individual sides of elements in
CSS.
Question (59) How can you remove the outline when an element is
clicked?
 Purpose: Assess understanding of removing outlines from elements based on user
interactions using CSS.
Question (60) How can you specify a font family for an element in
CSS?
 Purpose: Test knowledge of specifying font families for text using CSS.
Question (61) How can you set the font size in CSS?
 Purpose: Assess understanding of setting font sizes for text using CSS.
Question (62) How can you make text bold using CSS?
 Purpose: Test knowledge of specifying font weight for text using CSS.
Question (63) Can you use custom fonts in CSS?
 Purpose: Assess understanding of integrating custom fonts into CSS stylesheets.
Question (64) How can you style text to be italicized in CSS?
 Purpose: Test knowledge of specifying font style for text using CSS.
Question (65) How can you include icons in your HTML using CSS?
 Purpose: Assess understanding of using CSS to incorporate icons into HTML content.

6
Question (66) Can you change the color of an icon using CSS?
 Purpose: Test knowledge of changing the appearance of icons using CSS.
Question (67) How can you change the size of an icon using CSS?
 Purpose: Assess understanding of resizing icons using CSS.
Question (68) How can you add hover effects to icons in CSS?
 Purpose: Test knowledge of adding interactive hover effects to icons using CSS.
Question (69) How can you change the color of a link when it's
hovered over?
 Purpose: Assess understanding of applying hover effects to links using CSS.
Question (70) How can you remove the underline from a link?
 Purpose: Test knowledge of removing default text decoration from links using CSS.
Question (71) How can you style a visited link differently from an
unvisited link?
 Purpose: Assess understanding of styling visited links separately from unvisited links
using CSS.
Question (72) How can you remove the default bullets from an
unordered list?
 Purpose: Test knowledge of removing default list styles from unordered lists using CSS.
Question (73) How can you change the style of list items to squares?
 Purpose: Assess understanding of customizing list item markers using CSS.
Question (74) How can you align the content of list items
horizontally?
 Purpose: Test knowledge of aligning list item content horizontally using CSS.
Question (75) How can you add custom images as bullets for list
items?
 Purpose: Assess understanding of using custom images as list item markers in CSS.
Question (76) How can you remove the border from a table?
 Purpose: Test knowledge of removing borders from table elements using CSS.
Question (77) How can you alternate the background color of rows in
a table?
 Purpose: Assess understanding of styling alternating rows in tables using CSS.
Question (78) How can you align the text within table cells to the
center?
 Purpose: Test knowledge of aligning text horizontally within table cells using CSS.

7
Question (79) How can you add space between table cells?
 Purpose: Assess understanding of adding spacing between table cells using CSS.
Question (80) How can you style the header row of a table differently
from the rest of the rows?
 Purpose: Test knowledge of styling specific rows within tables differently using CSS.
Question (81) What is the default value of the display property for
most elements?
 Purpose: Assess understanding of the default display behavior of elements in CSS.
Question (82) How can you make an element take up only as much
width as necessary?
 Purpose: Test knowledge of making elements shrink-to-fit their content width using CSS.
Question (83) Differentiate between display:none and visibility: hidden
 Purpose: Assess understanding of the differences between hiding elements using CSS.
Question (84) How can you make elements flow horizontally next to
each other?
 Purpose: Test knowledge of creating horizontal layouts using CSS.
Question (85) How can you make an element behave like a table?
 Purpose: Assess understanding of using CSS to emulate table-like behavior for elements.
Question (86) What are the values for the position property?
 Purpose: Test knowledge of the different positioning schemes available in CSS.
Question (87) How can you position an element relative to its normal
position?
 Purpose: Assess understanding of positioning elements relative to their default position
using CSS.
Question (88) How can you position an element relative to its closest
positioned ancestor?
 Purpose: Test knowledge of positioning elements relative to their nearest positioned
ancestor using CSS.
Question (89) How can you fix an element to a specific position on the
viewport?
 Purpose: Assess understanding of fixing elements in a specific position on the viewport
using CSS.
Question (90) How can you make an element stick to a position within
its container when scrolling?
 Purpose: Test knowledge of creating elements with fixed positions within scrolling
containers using CSS.

8
Question (91) What happens when an element's content overflows its
specified size?
 Purpose: Assess understanding of how browsers handle overflow content when it
exceeds specified dimensions.
Question (92) How can you make the content of an element scrollable
when it overflows?
 Purpose: Test knowledge of making overflowing content scrollable within its container
using CSS.
Question (93) How can you hide the overflowing content of an
element?
 Purpose: Assess understanding of hiding overflow content within its container using CSS.
Question (94) How can you display only the horizontal overflow of an
element?
 Purpose: Test knowledge of displaying only horizontal overflow content within its
container using CSS.
Question (95) What does the float property do?
 Purpose: Assess understanding of the float property and its effect on element positioning
in CSS.
Question (96) How can you float an element to the left?
 Purpose: Test knowledge of floating elements to the left within their containing block
using CSS.
Question (97) How can you create a multi-column layout using floats?
 Purpose: Assess understanding of creating multi-column layouts using CSS floats.

You might also like