The next several exercises are timed. If you type slowly or dislike time pressure, feel free to increase the allotted time.
Name and email required. Check any number of boxes.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
0
0
0
Fill in the blank to specify the font color. | $("h2.important").___("color", "red"); | css | ^ *css *$ |
Fill in the blank to specify a red text color. | $("h2.important").css(___________); | "color", "red" | ^ *•color•, •red• *$ |
Fill in the blank to specify a font-size of 2em. | $("h2.important")._________________ | css("font-size", "2em"); | ^ *css\(•font-size•, •2em•\); *$ |
Assign a span whose ID is "special" a font-weight of "bold". | $("span#special").css("font-weight", "bold"); | ^ *\$\(•span#special•\).css\(•font-weight•, •bold•\); *$ | |
5. Drag-and-drop: Holding down the left mouse button, drag the pieces of code onto the screen to underline an h3 heading. | $("h3#important").css("text-decoration", "underline"); | ||
Change the color of all paragraphs whose class is "fade" to #d3d3d3. | $("p.fade").css("color", "#d3d3d3"); | $`(`"`p`.`fade`"`)`.`css`(`"`color`"`comma1space`"`#d3d3d3`"`)`; | |
Change the width of a div whose ID is "flex" to 45%. | $("div#flex").css("width", "45%"); | ||
Change the height of an image to 100px. Make up the image ID. | $("img#thumb").css("height", "100px"); | ^ *\$\(•img#.+•\)\.css\(•height•, •100px•\); *$ | |
Code the first line of code that specifies multiple CSS properties for all unordered lists. | $("ul").css({ | ^ *\$\(•ul•\)\.css\({ *$ | |
Code the first two lines of code that specifies multiple CSS properties for all elements whose class is "demote". The second line specifies a font-size of .75em. Don't forget the comma. | $(".demote").css({ "font-size": ".75em", | ^ *\$\(•\.demote•\)\.css\({\n *•font-size•: •\.75em•, *$ | |
Write the complete block of code that selects all divs and makes two changes to CSS styles. The font-size changes to 2em and the color changes to black. | $("div").css({ "font-size": "2em", "color": "black" }); | ^ *\$\(•div•\)\.css\({\n *•font-size•: •2em•,\n *•color•: •black•\n *}\); *$ | |
Turn all h2 headings red. | $("h2").css("color", "red"); | ^ *\$\(•h2•\)\.css\(•color•, •red•\); *$ | |
Change the width of a div whose ID is "flex" to 45%. | $("div#flex").css("width", "45%"); | ^ *\$\(•div#flex•\)\.css\(•width•, •45%•\); *$ | |
Change the height of an image to 100px. Make up the image ID. | $("img#thumb").css("height", "100px"); | ^ *\$\(•img#.+•\)\.css\(•height•, •100px•\); *$ | |
Code the first line of code that specifies multiple CSS properties for all unordered lists. | $("ul").css({ | ^ *\$\(•ul•\)\.css\({ *$ | |
Code the first two lines of code that specifies multiple CSS properties for all elements whose class is "demote". The second line specifies a font-size of .75em. Don't forget the comma. | $(".demote").css({ "font-size": ".75em", | ^ *\$\(•\.demote•\)\.css\({\n *•font-size•: •\.75em•, *$ | |
Write the complete block of code that selects all divs and makes two changes to CSS styles. The font-size changes to 2em and the color changes to black. | $("div").css({ "font-size": "2em", "color": "black" }); | ^ *\$\(•div•\)\.css\({\n *•font-size•: •2em•,\n *•color•: •black•\n *}\); *$ | |
Turn all h2 headings red. | $("h2").css("color", "red"); | ^ *\$\(•h2•\)\.css\(•color•, •red•\); *$ | |
http://jsfiddle.net/ASmarterWayToLearn/nxm64zdo/ | |||
http://jsfiddle.net/ASmarterWayToLearn/x6u695zz/ |