Html 文本在响应式设计中的地位 我有一个响应的布局,背景是中间的,没有指定宽度属性。 现在我想有一个div,它在背景图像的正内侧对齐

Html 文本在响应式设计中的地位 我有一个响应的布局,背景是中间的,没有指定宽度属性。 现在我想有一个div,它在背景图像的正内侧对齐,html,css,responsive-design,position,Html,Css,Responsive Design,Position,像这样: 回复Jasper Seinhorst 这就是问题所在。。它漂浮在舱外 HTML=> <div class="view_banner" style="background: url({$header.headerimg}) center 0 no-repeat;"> {if $header.copyright} <div class="copyright">Courtesy Cree Europe</div> {/if} </div>

像这样:

回复Jasper Seinhorst

这就是问题所在。。它漂浮在舱外

HTML=>

<div class="view_banner" style="background: url({$header.headerimg}) center 0 no-repeat;">
{if $header.copyright}
<div class="copyright">Courtesy Cree Europe</div>
{/if}
</div>

添加相对于具有背景图像的div的位置。 使用文本将绝对位置添加到div

#带背景的图像{
位置:相对位置;
宽度:200px;/*移除此*/
高度:50px;/*取下此*/
背景色:#ff0000;
}
#覆盖文本{
位置:绝对位置;
右:0;
底部:0;
背景色:#fff;
}

这里有文字

提供相关的html和css,而不仅仅是图像!我们应该想象这是一个CSS
背景图像
,还是应该想象这是一个带有
显示:块的
img
?或者我们应该完全想象别的什么?请,请,请包括相关的HTML和CSS。谢谢你的回答,但它没有解决我的问题。。检查我更新的问题..你能在你的问题中粘贴你的代码吗?检查编辑的问题..我想你的图像太小了,不能从边到边填充你的div。你能让你的背景图像100%吗?它的宽度为1100px,响应速度快,包装内有:margin:0 auto。我的图像没有指定任何宽度,否则它将不再响应。
.view_banner {position: relative; width: 100%; height:476px;}
 .copyright{position: absolute; right: 0; bottom: 0; font-size: 16px; color: black;}