我尝试在 div 的右侧显示图像(表示垂直显示的文本)。如下图所示,我的图像显示在 div 内部。但我想在 div 的右侧(外部)显示我的图像。
这是我的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;
}
谢谢。
最佳答案
试试这个。
<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>
关于css - 如何将图像放置在 div 外部但在右侧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7677704/