Friday, December 30, 2011

Inline-block in IE

display:inline-block;

This piece of code does not work in IE since inline-block is not recognized  in IE. To counter this we use an IE hack.

We should use:

display:inline;
zoom:1;

Also, suppose you have 2 inline-block elements inside one div. You will find that there is a gap of -4px between the elements which doesn't seem to go. This can be overcome by using:

.parentDiv{
  word-spacing:-4px
}
.childDiv{
  word-spacing:0px;
}

No comments:

Post a Comment