Friday, August 13, 2010

Why display:block; is important

So yeah i had seen display:block; listed on a lot of pages but never really took into account how helpful it was till i did the index page for our first website redesign.

To put it simple Display:block helps images look the same in both ie and firefox. So anytime you can't get image to look the same in ie and firefox i strongly recommend applying display:block something like this.

<img src="the image" style="display:block;">

  • The best results i have noticed is having it directly on the image but sometimes you can wrap the image in a div and put display:block in that div and that will work well to.