我正试图为我的网站在bigcartel上建立一个简单的登录页面。我正在尝试得到它,这样一个全屏图像占据了整个页面,并在被点击后直接指向产品页面,经过大量的研究,这是我想出来的
<head>
<a href="/products">
<img title="click to enter" src="http://i.imgur.com/QC0IqJ9.gif"
style="width: 100%"; style="height: 100vh">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
<
body {
background: src="http://i.imgur.com/QC0IqJ9.gif" ;
background-size: 100% 100%;
}
-->
<a {
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
}>
</style>
</a>
{{ head_content }}
</head>我的问题是,我无法让图像根据浏览器的分辨率进行拉伸和适配
发布于 2017-03-20 11:37:42
你的<style>中有一些非常奇怪的标签,但我假设是Scrapy-Splash的一部分。问题特别出在您的线路background: src="http://i.imgur.com/QC0IqJ9.gif";上。您正在设置CSS,所以您不需要设置src,而是像这样设置一个url():
body {
background: url("http://i.imgur.com/QC0IqJ9.gif");
background-size: 100% 100%;
}<body>
</body>
希望这能有所帮助!:)
https://stackoverflow.com/questions/42895285
复制相似问题