css - 如何将图像放置在 div 外部但在右侧

标签 css

我尝试在 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;
}

谢谢。

最佳答案

试试这个。

<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/

相关文章:

html - 当网页按比例缩小时,如何使图像堆叠在一起?

javascript - 如何使占位符文本出现而不是值文本

css - 网页背景

html - 无法让此按钮居中对齐

HTML 按钮不会右对齐

twitter-bootstrap - 多列表单上的标签高度

html - 如何在调整页面大小时(页脚)阻止 DIVS 发生冲突?

html - 将 "?v=1"附加到链接和脚本标记中的 CSS 和 JavaScript URL 有什么作用?

javascript - 如何在 jQuery 的 mousedown 事件监听器中混合悬停事件监听器?

html - Internet Explorer 屏幕中的可链接部分失败