2011-01-10 27 views
2

このレイアウトを取得するのに役立つCSSの教師がいますか?画像の中心を合わせる

.cover { 
    float:left; 
    margin-left:-50px; 
} 

、そこから行く:私はここにある何

<div class="movieList"> 
<div class="image" selected = true> 
<img class="poster" src="image1" selected = true/> 
</div> 
<div class="image"> 
<img class="poster" src="image1"/> 
</div> 
<div class="image"> 
    <img class="poster" src="image2"/> 
</div> 
. 
. 

</div> 

おかげで

答えて

6

スタートです。

例:http://jsfiddle.net/steve/T2qHR/(中心、純粋なCSS、効果を大きく)

+0

クイックアンカーのためのthks私はそれらのイメージを中心合わせする方法を基本レイアウトにしました...詳細を書いてください... – Praneeth

+0

ラウンド2 http://www.jsfiddle.net/hKQcX/ –

+0

@ Eric..please read私の上記のコメント..そして、何をしたのか、大変感謝しています。私は中央に画像を配置し、右側に画像を表示する必要があります。 – Praneeth

0

あなたはその後、中央にそのコンテナを揃えたい場合は、スティーブは正しい答えを持っているよりも、それらを表示したい場合は、次の

.cover { 
    margin: 0 auto; 
    width:600px; 
} 
+0

私はdidntの仕事を試しました – Praneeth

1

あなたのCSS

0123でこの http://www.jsfiddle.net/hKQcX/4/

$(function(){ 

    $('.movie').live('mouseover', function(){ 

    var $movie = $('.movie'); 
    $movie.css('z-index', 0); 
    $movie.css('opacity', .50); 
    $movie.css('width', '100px'); 
    $movie.css('height', '150px'); 
    $movie.css('margin-top', '0'); 

    var $this = $(this); 
    $this.css('z-index', 100); 
    $this.css('opacity', 1.00); 
    $this.css('width', '120px'); 
    $this.css('height', '180px'); 
    $this.css('margin-top', '-15px'); 

    }); 

    var i=0; 
    for (i;i<10;i++){ 
    if(i%2==0) 
     $('#container').append('<div class=\"movie red \"></div>'); 
    else 
     $('#container').append('<div class=\"movie green\"></div>') 
    } 
}); 

を参照してください。

+0

詳しい説明のためのThks ...実際のイメージを入れてみてください、そして、ホバリング画像は上に表示され、次の画像は表示されるはずです。私は、これはjqueryが必要ないCSSで達成できると思います。 – Praneeth

関連する問題