Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript and the DOM Making Changes to the DOM Set Inline Styles with the style Property

unclear explaining

form 8:30 to 9:13 it is against logic and you did not even explain it

2 Answers

"you want everything to display in the default style." where is that default style?!!

Steven Parker
Steven Parker
217,456 Points

The instructor does explain exactly what is being done. Starting at 8:30, he says:

"Finally, div elements like the list container, by default display as block-level elements.
So setting an inline display of block here seems a bit unnecessary.
So let's instead remove the inline style attribute from the list container.
You can remove an attribute from an element like style using the removeAttribute() method."

It seems very logical to remove the style element completely if you want everything to display in the default style. What about it seems "against logic" to you?

Steven Parker
Steven Parker
217,456 Points

Here's a handy CSS Default Values Reference from W3Schools.

You can also look up the default settings for individual properties in a reference like MDN. In this case, only the display property has been altered.