css完善的全屏图象背景

编程入门 行业动态 更新时间:2024-10-26 11:22:17
本文介绍了css完善的全屏图象背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想知道哪些是适合每个屏幕,每个浏览器的背景图片的最佳解决方案。我也注意到,大多数技术裁剪图像一点点。 我知道有很多技术来做到这一点,但我想知道哪个是你最好的意见。 谢谢!

I'm wondering which is the best solution for an background image to fit every screen, every browser. Also I've noticed that the majority of techniques crop the image a little bit. I know there are a lot of techniques to do this but I want to know which is the best in your opinion. Thanks!

推荐答案

此 post from CSS-tricks 涵盖了全屏背景图像的不同技术,包括旧版本IE的回退(我没有测试IE修复)。

This post from CSS-tricks covers different techniques for full screen background images and includes a fall-back for old versions of IE (I haven't tested the IE fix).

当我不需要担心支持旧的浏览器时,我通常使用CSS3方法:

When I don't need to worry about supporting old browsers, I generally use the CSS3 method:

html { background: url(lorempixum/1440/900/sports) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; }

更多推荐

css完善的全屏图象背景

本文发布于:2023-11-23 09:02:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1620861.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:全屏   图象   背景   css

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!