我刚刚建立了一个WordPress网站,希望有滑块图像设置为全屏。我现在有Slider Revolution和WPBakery Page Builder插件设置。
一切都刚刚成立该图像是在顶部不重叠的菜单。
我想的图像全屏显示这样一个在这个网站https://www.rentmycaravan.com/
我的网站是www.hiremytent.com。
谢谢。
你可以用CSS做如下图所示。只要确保你的背景图片来替换“image.jpg的”。
body{height:100%;
width:100%;
background-image:url(image.jpg);/*your background image*/
background-repeat:no-repeat;/*we want to have one single image not a repeated one*/
background-size:cover;/*this sets the image to fullscreen covering the whole screen*/
/*css hack for ie*/
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.image.jpg',sizingMethod='scale');
-ms-filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image.jpg',sizingMethod='scale')";
}
您还可以通过使用一些jQuery插件做到这一点:
试试这个:
body{height:100%;
width:100%;
background-image:url(test-image-camping.jpg);/*your background image*/
background-repeat:no-repeat;/*we want to have one single image not a repeated one*/
background-size:cover;/*this sets the image to fullscreen covering the whole screen*/
/*css hack for ie*/
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='.test-image-camping.jpg',sizingMethod='scale');
-ms-filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='test-image-camping.jpg',sizingMethod='scale')";
}
另外,您还可以设置图像到底层:
<img src='test-image-camping.jpg' style='position:fixed;top:0px;left:0px;width:100%;height:100%;z-index:-1;'>