CSS 中的纸张纹理?
是否可以用纯CSS制作这个纹理?
另请参阅此纹理:
Is it possible to make this texture in pure css?
See this also for texture: http://dribbble.com/shots/70256-Background-Textures
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
假设您不关心支持旧版浏览器,您可以这样做:
它是“纯 CSS”,对吧? =D
请参阅:数据 URI 方案
编辑:
看看您在 Evan Mulawski 的回答中留下的评论,这是我的 base64 字符串的解码后的 PNG:
我刚刚复制您在问题中提供的图像的一部分。它不能 100% 无缝平铺,但它看起来“足够好”,可以在没有人会看的 Base64 字符串中发布。
Assuming that you don't care about supporting older browsers, you can do this:
It's "pure CSS", right? =D
See: data URI scheme
Edit:
Looking at the comment you left on Evan Mulawski's answer, here is the decoded PNG of my base64 string:
I just copied a portion of the image you provided in your question. It doesn't tile 100% seamlessly, but it looked "good enough" for posting inside a base64 string noone would ever look at.
根据纹理的工作原理,您也许可以通过创建大量带有各种灰色阴影边框的定位
来实现此目的。
不。
Depending on how the texture works, you might be able to do it by creating an insanely large number of positioned
<div>
s with borders in various shades of gray.Don't.
你不能在 CSS 中做到这一点。您需要制作一个图像并在背景上重复它。
http://vandelaydesign.com/blog/design/photoshop-tutorials-textures/
You can't do that in CSS. You need to make an image and repeat it on the background.
http://vandelaydesign.com/blog/design/photoshop-tutorials-textures/
最好的方法是使用平铺图像设置背景图像属性。
Filter Forge (filterforge.com) 有一个过滤器库。看看是否可以在那里找到合适的图像,然后使用重复 x 和重复 y 来获得无缝背景。
The best way is to set the background image property using a tiled image.
Filter Forge (filterforge.com) has a filter library. See if you can find a suitable image there, then use repeat-x and repeat-y for a seamless background.