-
Which HTML attribute is used to set the text color?
a) text
b) fgcolor
c) color
d) style
Answer: d) style -
What is the correct syntax to set text color to red using inline CSS?
a)<p color="red">
b)<p style="color: red;">
c)<p text="red">
d)<p fgcolor="red">
Answer: b)<p style="color: red;"> -
Which property is used in CSS to change background color?
a) bgcolor
b) background-color
c) backcolor
d) color-background
Answer: b) background-color -
Which HTML tag supports the
bgcolorattribute in older HTML versions?
a)<body>
b)<p>
c)<span>
d)<title>
Answer: a)<body> -
How do you set a background color to yellow using inline style?
a)<div style="bgcolor: yellow;">
b)<div style="background-color: yellow;">
c)<div bg="yellow">
d)<div background="yellow">
Answer: b)<div style="background-color: yellow;"> -
Which color format is not valid in CSS?
a) Named colors
b) HEX codes
c) RGB values
d) YUV codes
Answer: d) YUV codes -
Which of the following is a valid HEX color code?
a) #123456
b) #12G45F
c) #ZZZZZZ
d) #1234
Answer: a) #123456 -
What is the HEX code for white?
a) #000000
b) #FFFFFF
c) #FFFF00
d) #FF00FF
Answer: b) #FFFFFF -
What is the RGB code for black?
a) rgb(255,255,255)
b) rgb(0,0,0)
c) rgb(0,255,0)
d) rgb(255,0,0)
Answer: b) rgb(0,0,0) -
Which format allows color with transparency in CSS?
a) HEX
b) RGB
c) RGBA
d) HSL
Answer: c) RGBA
-
What does the “A” stand for in RGBA?
a) Angle
b) Alpha (transparency)
c) Area
d) Amount
Answer: b) Alpha (transparency) -
Which color name is valid in HTML?
a) brightblue
b) neonorange
c) dodgerblue
d) supergreen
Answer: c) dodgerblue -
What is the default text color of a webpage?
a) Black
b) Blue
c) Gray
d) Depends on browser
Answer: d) Depends on browser -
Which tag can use the
colorproperty in CSS?
a) All text tags
b) Only <p>
c) Only <span>
d) Only <div>
Answer: a) All text tags -
Which tag can use the
bgcolorattribute directly in HTML 4.01?
a)<table>
b)<tr>
c)<td>
d) All of the above
Answer: d) All of the above -
How many characters are in a full HEX color code?
a) 3
b) 4
c) 6
d) 8
Answer: c) 6 -
What is the short HEX code for black?
a) #000
b) #FFF
c) #F0F
d) #F00
Answer: a) #000 -
What is the RGB value for pure red?
a) rgb(255,0,0)
b) rgb(0,255,0)
c) rgb(0,0,255)
d) rgb(128,128,128)
Answer: a) rgb(255,0,0) -
Which HSL value defines blue color?
a) hsl(0, 100%, 50%)
b) hsl(120, 100%, 50%)
c) hsl(240, 100%, 50%)
d) hsl(60, 100%, 50%)
Answer: c) hsl(240, 100%, 50%) -
Which color value allows brightness control using lightness?
a) HEX
b) RGB
c) HSL
d) CMYK
Answer: c) HSL
-
Which of the following sets text color to blue using CSS?
a) style=”font: blue”
b) style=”text-color: blue”
c) style=”color: blue”
d) style=”fontcolor=blue”
Answer: c) style=”color: blue” -
What value of alpha gives full transparency in RGBA?
a) 0
b) 0.5
c) 1
d) -1
Answer: a) 0 -
What value of alpha gives full opacity in RGBA?
a) 1
b) 0
c) 255
d) 100
Answer: a) 1 -
Which of these color codes is invalid?
a) #abc
b) #aabbcc
c) rgb(255, 255, 255)
d) #abcd
Answer: d) #abcd -
Which tool is used to pick a color from the screen?
a) Color Wheel
b) Eyedropper
c) Brush
d) Eraser
Answer: b) Eyedropper -
How do you make background fully transparent?
a) background-color: transparent;
b) background-color: rgba(0,0,0,1);
c) background-color: none;
d) background: 0%;
Answer: a) background-color: transparent; -
What is the default background color of HTML pages?
a) White
b) Gray
c) Transparent
d) Browser-defined
Answer: d) Browser-defined -
How many named colors are supported in HTML5?
a) 16
b) 50
c) 140
d) Unlimited
Answer: c) 140 -
Which of these is a valid named color in HTML?
a) skyblue
b) lemonyellow
c) firebrick
d) neongreen
Answer: c) firebrick -
Which color is represented by
#00FF00?
a) Red
b) Blue
c) Green
d) Cyan
Answer: c) Green
-
Which format is supported for coloring in inline CSS?
a) HEX
b) RGB
c) RGBA
d) All of the above
Answer: d) All of the above -
Which tag will inherit color from parent by default?
a)<span>
b)<div>
c)<p>
d) All of the above
Answer: d) All of the above -
Which of the following is used to apply color only to one word in a sentence?
a)<p>
b)<span>
c)<div>
d)<section>
Answer: b)<span> -
What is the valid CSS color value for semi-transparent red?
a) rgba(255, 0, 0, 0.5)
b) rgb(255, 0, 0, 0.5)
c) red, 0.5
d) #FF000080
Answer: a) rgba(255, 0, 0, 0.5) -
What does
color: inherit;do?
a) Sets default browser color
b) Uses color of parent element
c) Applies white color
d) Makes text invisible
Answer: b) Uses color of parent element -
Which CSS property is used to change the border color?
a) border-style
b) border-color
c) outline-color
d) edge-color
Answer: b) border-color -
Which attribute in HTML4 was used to change color of links?
a) color
b) link
c) text
d) a-color
Answer: b) link -
Which attribute in HTML was used to change visited link color?
a) color
b) visited
c) vlink
d) link-color
Answer: c) vlink -
Which value is correct for applying a color using HSL format?
a) hsl(0-360, %, %)
b) hsl(255, 255, 255)
c) hsl(#00ff00)
d) hsl(12,12,12)
Answer: a) hsl(0-360, %, %) -
Which one is the most flexible format for web designers to control transparency?
a) RGB
b) RGBA
c) HEX
d) Named Colors
Answer: b) RGBA
-
Which CSS property controls text color?
a) font-color
b) color
c) text-color
d) color-text
Answer: b) color -
Which of these does NOT affect color rendering in browser?
a) Monitor calibration
b) Browser settings
c) Internet speed
d) CSS applied
Answer: c) Internet speed -
Which function defines transparency level in HSL format?
a) opacity
b) alpha
c) hsla
d) none
Answer: c) hsla -
What is the value range for red in RGB?
a) 0 to 255
b) 0 to 100
c) 1 to 100
d) 0 to 1
Answer: a) 0 to 255 -
Which color property value is invalid?
a) #FFF
b) red
c) rgb(256,0,0)
d) rgba(0,0,0,0.5)
Answer: c) rgb(256,0,0) -
How can you apply background color to the whole page?
a)<body style="background-color: lightblue;">
b)<head style="background-color: lightblue;">
c)<title style="bgcolor: lightblue;">
d)<html style="background: lightblue;">
Answer: a)<body style="background-color: lightblue;"> -
What is the color of
#FF0000?
a) Green
b) Blue
c) Red
d) Yellow
Answer: c) Red -
Which one is not a valid CSS color format?
a) rgba(255, 0, 0, 0.5)
b) #FF00FF
c) color=red
d) hsl(0, 100%, 50%)
Answer: c) color=red -
Which color format uses a percentage for saturation and lightness?
a) RGB
b) RGBA
c) HSL
d) HEX
Answer: c) HSL -
What is the difference between
transparentandrgba(0,0,0,0)?
a) No difference
b)transparentis a keyword
c)transparentdoes not work in older browsers
d) rgba is slower
Answer: b)transparentis a keyword
