如何根据背景图像而不是窗口浏览器定位图像 [英] How to position images according to background image and not window browser

查看:81
本文介绍了如何根据背景图像而不是窗口浏览器定位图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经问过这个问题,但没有人似乎得到我说的,因为它是在写作,所以我现在做了一个2:12分钟。视频,其中我说明了我的问题。

I have asked this question before but no one seemed to get what i was saying since it was in writing so i have now made a 2:12 min. video where I illustrate my problem.

视频的链接: https://www.youtube.com/watch?v=7XfQS_-gp98&feature=youtu.be

此问题的相关CSS代码:

The relavant css code for this problem:

#BackgroundImage{
position: absolute;
width: 100%;
hight: 100%;

}

#Frame{
position: absolute;
width: 34.68%;
height: auto;

}

#Logo{
position: absolute;
width: 19.32%;
top: 8.5%;
left: 5%;
height: auto;
}



我已经做了一个小提琴,你可以找到相关的html代码aswell case任何需要它。

I have made a fiddle aswell where you can find the relavant html code aswell in case any needs it.

https://jsfiddle.net/ff154bsa/

Thx预先为任何贡献!

Thx in advance for any contribution!

推荐答案

您的顶部:8,5%是指身高。如果你参考宽度怎么办?尝试以这种方式引用错误的宽度:

Your top:8,5% refers to the height. What if you refer to the width? Try to refer the misure to the width in this way:

top:8vw;

这篇关于如何根据背景图像而不是窗口浏览器定位图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆