HTML and CSS Reference
In-Depth Information
Correct answer: C
4.
Incorrect: <div> elements flow left to right and top to bottom and don't provide
any structure.
A.
Incorrect: The <p> element denotes a paragraph. This element doesn't provide
any layout structure to the page.
B.
Correct: You use the <table> element to provide a structured layout, using its
rows and columns elements as needed to create the desired layout.
C.
Incorrect: The <form> element is used to denote an area where the user can sub-
mit data. The <form> element doesn't provide any mechanism to control layout.
D.
Objective 1.2: Thought experiment
This thought experiment speaks directly to performance. As the number of balls increases,
the demand on the graphics engine and local resources such as CPU and memory becomes
more intense. The <canvas> element is better designed to perform this duty. From a coding
perspective, this experiment provides insight into capturing events from the canvas, calcu-
lating the location of the click in relation to the balls on the screen, and creating new balls
dynamically as they get clicked. These computations need to occur quickly as the graphics
are redrawn. The implementation of such a game would be too involved for the scope of
this topic. However, the notion of performance is an important concept to be clear on with
respect to graphics rendering.
Objective 1.2: Review
Correct answer: D
1.
Incorrect: The getElementById method retrieves an element by its unique id .
A.
Incorrect: The querySelector method retrieves a single element that matches the
specified selector.
B.
Incorrect: The getElementsByClassName method retrieves all the elements that
have the specified CSS class assigned to them.
C.
Correct: The queryAll method isn't available to search the DOM.
D.
Correct answer: A
2.
Correct: document.getElementbyId(“myDog”); retrieves only the single image with
the ID myDog .
A.
Incorrect: <p>.getChildNode(“img”); isn't a valid syntax.
B.
Incorrect: document.getElementbyId(“dogs).querySelector (“thumb”); fails
because the page has no element named “dogs”.
C.
Incorrect: document.querySelector.querySelectorAll(“thumb”); is incorrect
because it returns all the elements on the page with the specified class name.
D.
Search WWH ::




Custom Search