exam questions

Exam 70-480 All Questions

View all questions & answers for the 70-480 exam

Exam 70-480 topic 4 question 37 discussion

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

You develop an HTML5 webpage with custom CSS. You have the following HTML markup:
<div class="new" Item">...</div>
You have the following requirements:
✑ In addition to your CSS, you must use a corporate branded stylesheet named corporate.css.
✑ The corporate.css file contains the style rule that must be used for .newsItem.
✑ You must use the corporate.css file to ensure that the webpage changes when the brand changes.
✑ You must add additional style rules to the webpage.
✑ You cannot modify the corporate.css file.
You need to apply the appropriate CSS rules to meet the requirements.
What should you do?

  • A. Add a CSS class named .newsItemUpdates to the webpage, add only the new styles to this class, and update the class attribute of the HTML markup: <div class=nnewsltem newsItemUpdates">..,</div>
  • B. Update the corporate.css file to include! important for each rule for the .newsItem. class, and add the new CSS rules to the webpage by using the CSS class .newsItem.
  • C. Add a CSS class named .newsitemUpdates to the webpage, add the new styles to this class, and update the HTML markup to replace the .newsItem class with this new class: <div class*"newsItemOpdates">...</div>
  • D. Add the new CSS rules to the webpage by using the CSS class .newsItem, and add! important to each rule.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️
CSS attempts to create a balance of power between author and user style sheets. By default, rules in an author's style sheet override those in a user's style sheet.
However, for balance, an "!important" declaration (the delimiter token "!" and keyword "important" follow the declaration) takes precedence over a normal declaration. Both author and user style sheets may contain "!important" declarations, and user "!important" rules override author "!important" rules. This CSS feature improves accessibility of documents by giving users with special requirements (large fonts, color combinations, etc.) control over presentation.
Incorrect Answers:
B: It is stated that you are not allowed to update the corporate.css file.
Reference: Assigning property values, Cascading, and Inheritance, !important rules

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
angela2021
4 years, 5 months ago
D is correct.
upvoted 1 times
...
northgaterebel
4 years, 5 months ago
It is unclear to me whether corporate.css takes precedence over the additional rules. Let's say the additional styles overwrite every style in corporate. The page would lose branding. Too many assumptions in this question. Grrr!
upvoted 1 times
...
JMz123
5 years, 7 months ago
It is unclear to me why A isn't the answer. There is a typo, but this web site is loaded with typos.
upvoted 4 times
rshirts
5 years, 7 months ago
because corporate.css may contain styles for the element, so to make sure your styles are used you can use !important.
upvoted 5 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 ...