+ 5

Some of the properties in CSS have the option of a "none" value. In what situation would you specify the value as none?

I'm going through the CSS course (specifically the section about working with text) and I've seen none as a value a couple of times. I thought none meant no styling, so that's default, right? Then why specifically set the value to none? The only thing I can think of is if you don't want that specific property to inherit from a parent element, but I'm relatively new so that might be way off base. I'm so confused right now and I couldn't immediately find an answer to my specific question online, so any help is very welcome!

13th Jul 2018, 1:05 AM
N@G3
N@G3 - avatar
3 Answers
+ 2
Thanks, Janning⭐ That did help. Like you said, I know I'll figure out a use on my own as I code more, but it helps to have at least an idea to help me understand how everything works!
13th Jul 2018, 3:09 AM
N@G3
N@G3 - avatar
+ 1
Hi N@G3, A common example is "display: none;" for toggling between showing an element and hiding it. You may also want to use it to specify when you want to override the default styling of something or override the user-agent stylesheet. These are just some of the more common reasons to use this. As you experiment more, you will inevitably run into more interesting use cases. I hope this helps! â˜ș
13th Jul 2018, 1:58 AM
Janning⭐
Janning⭐ - avatar
0
👍
13th Jul 2018, 5:00 AM
Janning⭐
Janning⭐ - avatar