exam questions

Exam 70-480 All Questions

View all questions & answers for the 70-480 exam

Exam 70-480 topic 2 question 24 discussion

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

You are developing an HTML5 page that has an element with an ID of picture. The page includes the following HTML.

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

  • A. document.getEIementById("picture").style.position = "relative";
  • B. document.getElementById("picture").style.top = "5px";
  • C. document.getEiementById("picture").style.top = "-5px";
  • D. document.getEIementById("picture").style.position = "absolute";
Show Suggested Answer Hide Answer
Suggested Answer: AB 🗳️
We use relative position to move the position 5 pixels lower on page.
Using a negative value would move the picture higher on the page.
Note:
* The top property sets or returns the top position of a positioned element.
This property specifies the top position of the element including padding, scrollbar, border and margin.

Syntax -
Set the top property:
Object.style.top="auto|length|%|inherit"
Where:
Length defines the top position in length units. Negative values are allowed

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
Leonard
4 years, 5 months ago
I tried in a clean .html page and it is A and B.
upvoted 1 times
...
MrAnderson
5 years, 1 month ago
It must be B & D. The relative position adds another 5px to its normal position so it will move down 10px. The question asks to move only 5px not 10px.
upvoted 1 times
MrAnderson
5 years, 1 month ago
Ok, I am wrong it is AB. I just got a little confused.
upvoted 4 times
...
...
PhiDang
5 years, 4 months ago
I think that the correct answers are B & D. When you used position: relative, the top attribute will not work.
upvoted 4 times
stef1
5 years, 3 months ago
You're wrong, please try it. AB is definitely correct.
upvoted 3 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 ...