04. Traverse DOM πŸ‘©β€πŸŽ“πŸ‘¨β€πŸŽ“

πŸ› Style Changes on HTML Elements Not Rendering on Page

Work with a partner to resolve the following issues:

  • Users should be able to see style changes implemented with JavaScript when the browser page loads.

  • Fix the code so that the actual behavior reflects the expected behavior

Expected Behavior

  • The article title has a font size of 50px.

  • The text in the headline “Welcome to World News” is white.

Actual Behavior

  • The article title is smaller than 50px.

  • The text in the headline “Welcome to World News” is blue.

Assets

The following image demonstrates the web application’s appearance and functionality:

On the World News webpage, "Welcome to World News" is the title of the page, and the article title on the page is larger than the webpage title.


πŸ’‘ Hints

How would you use parent-child relationships to access the elements you want to style?

πŸ† Bonus

If you have completed this activity, work through the following challenge with your partner to further your knowledge:

  • Using getElementbyId() is just one way to return an element. What are some other document methods that allow us to quickly access elements?

Use Google or another search engine to research this.


βœ… Solutions

Solutions Click Here