为网站创建固定背景 [英] Creating a fixed background for a website

查看:58
本文介绍了为网站创建固定背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为类似此处的网站建立固定背景。到处搜索告诉我可以使用background:固定的或背景附加属性。

I am trying to implement a fixed background for a website like one over here. Searching around for it told me that I can use background: fixed or background-attachment properties for this.

我的问题是用作背景的图像。我正在考虑以下问题:

My problem is the image which will be used as background. I am thinking about following issues:


  • 图像大小应该是什么?

  • 它将如何重复?当浏览器窗口大小很大时?大型27英寸显示器在那里?

有人可以在这些方面指导我吗?

Can somebody guide me on these points?

关于
Vikram

Regards Vikram

推荐答案

没有具体的指导原则,您需要使图像尽可能大如果您希望某人在30英寸显示屏上使用最大化的浏览器窗口来查看单个不间断的非重复背景图像,那么是的,您将需要一个较大的图像。表现良好。

There's no specific guideline. You need to make the image as large as necessary to satisfy the requirements of the design. If you want someone with a maximized browser window on a 30-inch display to see a single unbroken non-repeating background image, then yes, you'll need quite a large image. It won't perform well.

Twitter示例是宽幅但短的图像,设置为沿其x轴重复。它的宽度为2247像素,但可能没有必要:实际上,它是一个固定的图案,在该2247像素图像内水平重复四次尽管如此,您还是有一个主意:制作一个图像,使其边缘处优雅地融合到自身中以实现无缝平铺,和/或融合到固定的背景色中河定位并根据需要重复该操作,设置页面的背景颜色,即可完成。

The Twitter example is a wide but short image, set to repeat along its x-axis. It's wide at 2247 pixels, but perhaps unnecessarily so: it actually appears to be a fixed pattern that repeats horizontally four times within that 2247 pixel image. Nonetheless, you get the idea: make an image that blends gracefully into itself at its edges for seamless tiling, and/or blends into a fixed background color. Position and repeat it as needed, set the background-color of the page, and you're done.

这篇关于为网站创建固定背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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