PrepAway - Latest Free Exam Questions & Answers

Which lines of code should you use?

You are developing an HTML5 page that has an element with an ID of logo. The page
includes the following HTML.
<div>
Logo:<br>
<div id=”logo”>
</div>
</div>

You need to move the logo element lower on the page by five pixels.
Which lines of code should you use? (Each correct answer presents part of the solution.
Choose two.)

PrepAway - Latest Free Exam Questions & Answers

A.
document.getElementById(“logo”) .style.position = “relative”;

B.
document.getElementByld(“logo”).Style.top = “5px”;

C.
document.getElementById(“logo”).style.top = “-5px”;

D.
document.getElementById(“logo”).style.position = “absolute”;

Explanation:

http://www.w3schools.com/cssref/pr_class_position.asp
http://www.w3schools.com/cssref/pr_pos_top.asp

2 Comments on “Which lines of code should you use?

  1. Will says:

    NOTE: Capitalization does matter in JavaScript. Answer B should have lower case “s” for the word style:

    document.getElementById(“logo”).style.top=”5px”;




    2



    0

Leave a Reply