• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

My Monkey Do

A Log of Coding Solutions

  • Home
  • Web Hosts
  • Tools
  • About

Space Under Image Link

March 20, 2013 by Webhead

Problem

I had the following code like so:

<div class=”someborder”><a href=”#”><img src=”someimage.png”></a></div><div>some text</div>

The class “someborder” basically made a border around the image.  The problem was that there would be some space under the image and then the border would show.  I took off all padding and margins on the image and divs and the space still would not go away.

Solution

Simple as vertical-align:text-bottom.  I’m guessing this works because I have some text in the next div.  Not sure why the text in another div would affect the image, but ok, it works.

img {
vertical-align: text-bottom;
}

 

source: http://csscreator.com/node/110

Filed Under: Coding Tagged With: css, html

Primary Sidebar

Topics

502 apache apple bluehost bootstrap buddypress chrome cloudways cms css debug drupal eCommerce firebug firefox git goDaddy google google analytics google maps hacked hosting htaccess html html 5 icons IE crap image iPad iPhone javascript jquery linux localization mac os x ms sql mysql open source optimize php tinymce wordpress wpengine yii youtube




Categories

  • Coding
  • Off the Shelf
  • Plugins
  • Random Thoughts
  • Server Stuff
  • Tools