Posts Tagged div tag

Hide empty DIV tags in HTML / ASP .Net using CSS

Empty div tags can create a horizontal gap on html or aspx pages. display:block is the common attribute used in CSS to hide the empty div tag. But unfortunately it does not work on all browsers. Even different versions of same browser interprets this attribute in different ways.

We can use combination of different attributes to make it work. e.g.

.cssClassName
{

display:block;
clear:both;
visibility:hidden;
line-height:0;
font-size:0;

}

,

Leave a comment