Search code examples
csslayouthtmlblock

Div element set as block. Why?


I sometimes see DIV set to display:block Is there any particular reason considering DIV is already a block box.


Solution

  • 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).