背景图像调整大小以适应 [英] Background image resizing to fit

查看:97
本文介绍了背景图像调整大小以适应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让背景图片尽可能专业,所以我认为最好根据浏览器的大小或分辨率(不确定通常使用的是什么,但我认为浏览器的大小有意义这里)。想法是如果观察者屏幕小,背景图像变得更小,并且随着屏幕变大,图像扩展到适合其最大尺寸。

I'm trying to make the background image as professional as possible so I'm thinking it's best to resize it based on the size of the browser or the resolution (not sure what's usually used, but I think browser size makes sense here). The idea is if the viewer screen is small, the background image gets smaller, and as the screen gets bigger, the image expands to fit its maximum size.

我将根据需要尝试一个CSS或者甚至Javascript(JQuery)解决方案。

I will try a CSS or even Javascript (JQuery) solution as needed.

推荐答案

我想你正在寻找这样的东西:

I guess you're looking for something like that:

http://css-tricks.com/how-to-resizeable-background-image/

这篇关于背景图像调整大小以适应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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