+ 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!
3 Respuestas
+ 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!
+ 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! ☺
0
👍