我需要做什么(并且失败)是这样的网站:带边框的全屏幕背景图片
网站需要全屏,没有滚动。 我不太满意的结果,因为:
- 当网页被打开的垂直帘(智能手机)在底边框太大
-I也试图让这个背景图像显示完全顶底部(我想面对顶部和底部全面看,而不仅仅是部分),但我真的不知道该怎么做。
我的CSS代码:
body {
background: url('http://web-industry.eu/landing/img/bg.png') no-repeat;
background-size: 100% 100%;
width: 100vw;
height: 100vh;
box-sizing: border-box;
border: #f36d32 3px solid;
padding: 0;
margin: 0;
}
<body></body>
:
html
{
background: #f36d32;
width: 98%;
height: 95.9%;
padding: 1%;
}
body
{
background: url(http://web-industry.eu/landing/img/bg.png) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
width: 100%;
height: 100%;
}
好,边界问题是由@imGaurav用这样的代码来解决但我仍然无法弄清楚如何使顶面和底面都可见。
你能分享你的代码吗? –
请发布您的jsfiddle。 – Alex
对不起,这里是我的代码:https://jsfiddle.net/24rcLmsj/ – engray