Q1. CSS syntax is divided into _ parts:
A. Selector and Declaration
B. Property name and value
C. Color and style
D. None of these
Q2. Which of the following is correct?
A. Style sheets allow content to be optimized for more than one type of device.
B. CSS can store web applications locally with the help of an offline cache.
C. Using CSS, we can view offline websites. The cache also ensures faster loading and better overall performance of the website.
D. All of the above.
Q3. What is the proper HTML syntax for referencing an external style sheet?
A. <style src="demostyle.css">
B. <stylesheet>demostyle.css</stylesheet>
C. <link rel="stylesheet" type="text/css" href="demostyle.css">
D. None of these
Q4. The "color:black" in CSS syntax is known as:
A. Value
B. Declaration
C. Selector
D. Rule
Q5. Which of the following is true for pseudo class in CSS?
A. Match a specified element
B. Select the active links
C. Are used to select all the visited links
D. Are used to define a special state of an element
Q6. Which type of CSS is used in the below code?
<p style="border:2px solid red;">
A. Inline CSS
B. Internal CSS
C. External CSS
D. None of the above
Q7. Which of the following is used to make the text bold?
A. text-align: bold
B. font-style: bold
C. font-weight: bold
D. text-decoration: bold
Q8.How can one change the font of an element?
A. font-family
B. font-face
C. font-variant
D. font-style
Q.9 Which of the following CSS selectors are used to specify a group of elements?
A. tag
B. id
C. class
D. both class & tag
Q.10 Which CSS property is used to set the background image of an element?
A. background-attachment
B. background-image
C. background-color
D. None of the above
Q.11 The HTML attribute used to define the inline styles is:
A. style
B. styles
C. class
D. None of the above
Q.12 Correct syntax to make the background-color of all paragraph elements yellow:
A. p (background-color : yellow;)
B. p {background-color : #yellow;}
C. all {background-color : yellow;}
D. p {background-color : yellow;}
Q.13 A CSS style rule is made up of three parts: Selector, Property and _
A. value
B. function
C. tag
D. None of these
Q.14 Valid ways to specify white color using CSS:
A. Only I (#FFFFFF)
B. Only III (rgb(FF, FF, FF))
C. Both I and III
D. Both I and II (rgb(255, 255, 255))
Q.15 In CSS, selectors are used to select the elements you want to style:
A. Classes
B. Patterns
C. Properties
D. Functions
Q.16 CSS attributes to create a pink dotted border around an image:
A. border-line
B. border-style
C. border-color
D. Both II and III
Q.17 Property that sets a variation of the specified or default font family:
A. Height
B. font-variant
C. font-weight
D. default
Q.18 Property that specifies the distance between borders of adjacent cells:
A. border-spacing-cell
B. border-width-spacing
C. border-spacing
D. cell spacing
Q.19 Selector that applies styles to elements valid per HTML5 validations:
A. :valid
B. :required
C. :optional
D. :invalid
Q.20 To control image repetition in CSS, the correct option is:
A. h1 {background-loop: none;}
B. h1 {background-repeat: none;}
C. h1 {background-iterate: none;}
D. None of the above
Q.21 Which selector selects elements that are currently enabled?
A. :element
B. :empty
C. :enabled
D. None of the mentioned
Q.22 What type of selector is used in this case? P {line-height:150%;}
A. class selector
B. element selector
C. id selector
D. none of the mentioned
Q.23 CSS's position property default value is:
A. Relative
B. Absolute
C. Fixed
D. Static
Q.24 Which CSS selector is used to define a single element's style?
A. Id
B. Class
C. Text
D. Name
Q.25 Which property of an anchor element indicates the user is currently clicking?
A. :link
B. :visited
C. :hover
D. :active
Q.26 How to insert multiple line comments in a CSS file?
A. // statement
B. 'statement
C. /* statement */
D. // statement //
Q.27 Which element is used in the <HEAD> section to link external style sheet?
A. <src>
B. <link>
C. <style>
D. <css>
Q.28 How will you make all paragraph elements grey in color?
A. p.all {color: grey;}
B. p.all {color: #990000;}
C. all.p {color: #998877;}
D. p {color: grey;}
Q.29 Which is used to apply a specific rule and cannot be overridden in CSS?
A. @important
B. !important!
C. !important
D. important!
Q.30 Which CSS property is used to wrap text around an image?
A. Float
B. Push
C. Align
D. Wrap
Q.31 Which CSS property adds margin between a DIV's border and its inner text?
A. spacing
B. margin
C. padding
D. inner-margin
Q.32 In the transition transition:color .4s linear;, what does ".4s" describe?
A. Word-spacing
B. Padding
C. Duration
D. Property
Q.33 Which CSS property resizes a video or image to fit its content box?
A. Position
B. Object-position
C. Object-fit
D. None of these
Q.34 How to remove underline from all hyperlinks using CSS?
A. a {text-decoration: no-underline;}
B. a {text: no-underline;}
C. a {text-decoration: none;}
D. a {text-style: no-underline;}
Q.35 Which CSS property prevents a floating div on the left side of an element?
A. margin
B. clear
C. float
D. padding
Q.36 To create a green dotted border around an image, which property is used?
A. border-color
B. border-style
C. border-decoration
D. border-line
Q.37 Purpose of CSS padding property:
A. Border
B. Space
C. Background Color
D. Margin
Q.38 Which property selects a normal or small-caps face from a font-family?
A. font-weight
B. font-synthesis
C. font-kerning
D. font-variant
Q.39 Correct ways to apply styles in CSS:
A. Inside an HTML element
B. In an external CSS file
C. Inside the <head> section of an HTML page
D. All of the above
Q.40 Which property displays border around a cell without content?
A. empty-cell
B. blank-cell
C. noncontent-cell
D. void-cell
Q.41 What will happen in the following case? h1 {color: red text-decoration: underline; font-style: italic;}
A. All properties work
B. Only text-decoration and font-style work
C. Only color and text-decoration work
D. Only font-style works
Q.42 Which of the following is not possible to animate using CSS?
A. Padding
B. Word-spacing
C. Text-transform
D. Width
Q.43 Which selector selects elements based on a certain state?
A. Combinator selector
B. Pseudo class selector
C. Pseudo elements selector
D. Attribute selector
Q.44 Which property sets the width of an element's complete border?
A. border-width
B. width
C. border-depth
D. None of the above
Q.45 Which CSS property helps decide how overflowed text is displayed?
A. text-decoration
B. text-stroke
C. text-shadow
D. text-overflow
Q.46 Which CSS property specifies the clarity of the image?
A. Overlay
B. Clearfix
C. Clarity
D. Opacity
Q.47 A rendering engine is not responsible for:
A. Parsing markup content (HTML)
B. Parsing style information (CSS, XSL, etc.)
C. Generating visual representation including media files
D. Parsing style information (CSS only)
Q.48 Identify the uses of URI in HTML:
A. (i) and (ii)
B. (i) and (iii)
C. (ii) and (iii)
D. (i), (ii) and (iii)
Q.49 Which option helps specify the stack order of overlapping elements?
A. z-index
B. overlap
C. No such specific property
D. None of the above
Q.50 Which of the following is a correct CSS syntax?
A. {body;color:orange;}
B. {body:color=orange;}
C. body:color=orange;
D. body {color:orange;}