-1

The title basically says my problem. I basically want to have 2 images aligned next to eachother, one on the left and one on the right; I would just use <img src> but I want the alignment to be properly done. I have been looking around but I can't seem to find anything related to my search.

Also, if there's a way to make a displayed image in black and white, and when hovered over; it displays the correct image (which is in color) - just to give it an effect?

JJJ
  • 32,902
  • 20
  • 89
  • 102
Reverb
  • 953
  • 2
  • 12
  • 17

2 Answers2

0

About align your 2 images you can try to apply float property at CSS like:

.image {
float:left;
}
Weimin Ye
  • 665
  • 4
  • 15
0

Fiddle: http://jsfiddle.net/5ajFK/

The <img src> is wrapped in a span and it is positioned absolute. The black and white effects can be implemented using CSS filter which activates when the mouse is placed on the image.

$('img').mouseenter(function(){
    $(this).addClass('desaturate');    
});
$('img').mouseleave(function(){
    $(this).removeClass('desaturate');    
});

The CSS for b&w effect:

img.desaturate { -webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
filter: grayscale(100%);
}
k360
  • 61
  • 4