2013-10-08 27 views
0

我有一个图像,我集中了display: block;margin: auto;,我试图部分重叠下面的div。我似乎无法弄清楚我的代码出了什么问题,并且我在网上找不到任何信息(我真的搜索过!)。我讨厌问,但我可以混合相对位置和边距自动?那是什么问题?下面是代码:相对定位,边距自动和一个IMG作为块

HTML:

<div class='container'>   
    <img class='img-circle bio_pic' src='img/Matthew_bio_fin.jpg'>  
    <div class="jumbotron"> 
     <div class="container"> 
      <h1>Hi! I'm ...!</h1> 
      <p>...</p> 
     </div> 
</div> 

CSS:

.bio_pic { 
    width: 190px; 
    height: 150px; 
    margin: 0 auto 0 auto; 
    border: solid green 4px; 
    display: block; 
    position: relative; 
    top: 80; 
    z-index: 5; 
} 
+0

目前尚不清楚你想要达到的目的。这是输出.. http://jsfiddle.net/G9Fxs/ –

回答

1

你缺少单位:

top: 80px; 
+0

Tehe。 ;)记得标记为接受:) –