2011-10-06 124 views
0

我试图在div的右侧显示图像(表示垂直显示的文本)。正如您在下面的图片中看到的,我的图像显示在div的内部。但我想在div(外部)的右侧显示我的图像。如何在div的右侧放置图像外部的图像

enter image description here

这里是我的CSS:

.outer-gray 
{ 
width: auto; 
border: 1px solid #efefed; 
border-collapse: collapse; 
margin-right: 20px; 
display:block; 
background: transparent url('Images/framework-asp-net-mvc3.png') no-repeat bottom right; 
} 

谢谢。

+0

相关:[在所有四个拐角DIV的附加图像](http://stackoverflow.com/questions/17306087/attach-images-on-all-four-corner-of-div)&[智能在所有四个角落添加角落图像到DIV边框的方法](http://stackoverflow.com/questions/6467063/smart-way-to-add-corner-image-to-div-border-on-all-four-角落)。 –

回答

0

试试这个。

<div class="container"> 
    a lot of content 
    <div class="outter"></div> 
</div> 
<style> 
    .container{position:relative} 
    .outter{ 
     position:absolute; 
     right:-10px; 
     bottom:0; 
     height:200px; 
     width:10px; 
     background:url(some.png) no-repeat 
    } 
</style> 
+0

你指给我正确的方向。谢谢。 – Bronzato