You are developing a web page that has a group of HI and H2 elements. The page also includes a CSS
class named underlineMe.
You have the following requirements:
The font color of all H1 and H2 elements must be changed to red.
The CSS class underlineMe must be applied to all H1 and H2 elements.
You need to update the web page to meet the requirements.
Which code segment should you use?
A.
Option A
B.
Option B
C.
Option C
D.
Option D
Explanation:
Reference:
http://www.w3schools.com/jquery/sel_header.asp
Does the add class not overwrite the css color red with the underline me class?
Nope, it just appends the class. A item can have multiple CSS classes associated with it but only one id. Also, underline is a text-transform object and color is a separate field.
Reference:
https://api.jquery.com/addclass/
https://jsfiddle.net/ynp4y2j7/
It’s work fine… check this code:
https://jsfiddle.net/c0rew5p3/