exam questions

Exam 70-480 All Questions

View all questions & answers for the 70-480 exam

Exam 70-480 topic 1 question 18 discussion

Actual exam question from Microsoft's 70-480
Question #: 18
Topic #: 1
[All 70-480 Questions]

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.)

  • 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";
Show Suggested Answer Hide Answer
Suggested Answer: AB 🗳️
* style.position = "relative";
The element is positioned relative to its normal position, so "left:20" adds 20 pixels to the element's LEFT position.
* For relatively positioned elements, the top property sets the top edge of an element to a unit above/below its normal position.

Example: Example -
Set the top edge of the image to 5px below the top edge of its normal position: img { position: relative; top: 5px;
}
Reference: CSS position Property; CSS top Property
http://www.w3schools.com/cssref/pr_class_position.asp
http://www.w3schools.com/cssref/pr_pos_top.asp

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
superhands
5 years, 3 months ago
I don't think Styles (with capital S) will actually work in a browser. (answer B)
upvoted 1 times
...
JMz123
5 years, 8 months ago
Think Style s/b l.c.
upvoted 1 times
stef1
5 years, 3 months ago
Not sure what you're trying to say, but the selected answer AB is correct.
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...