Reputation: 5078
I sometimes see DIV set to display:block
Is there any particular reason considering DIV is already a block box.
Upvotes: 4
Views: 218
Reputation: 3065
You could be over-riding another CSS attribute that said
.myClass {
display: inline;
}
Or replacing display:none;
to "un-hide" it (typically this is done on-the-fly by javascript).
Upvotes: 11
Reputation: 3089
If you're overriding an existing style it makes sense. Setting a div to block that has no styles coming in from elsewhere does not.
Upvotes: 2
Reputation: 324620
It may be to override another style that may be setting it to something else, but otherwise it's most likely a reminder to whoever wrote it. There's no real reason to include that rule.
Upvotes: 4