The Div element is set as a block. What for?

I sometimes see that the DIV is set to display:block Is there any special reason considering the DIV is already a block block.

+4
source share
3 answers

You can override another CSS attribute that said

 .myClass { display: inline; } 

Or replace display:none; to "un hide" (this is usually done on the fly javascript).

+11
source

Perhaps you need to redefine another style that can be tied to something else, but otherwise it is more of a reminder to the person who wrote it. There is no real reason to include this rule.

+4
source

If you redefine an existing style, that makes sense. Setting a div to lock, which has no styles coming from other sources, does not work.

+2
source

Source: https://habr.com/ru/post/1445859/


All Articles