调整背景大小以适应内容?
嘿大家!我正在设置我的网站,我正在尝试找到一种方法让我的背景图像(或任何图像)根据内容自行调整其大小。
我的背景由 4 个角、4 个边和中间的填充组成。是否可以重新调整大小?我想如何使用它的示例:
我的背景图像当前支持大约 4 个段落,并且位于底部。如果我想要 7-8 段怎么办?我是否需要手动将图像重新制作得更长,或者我可以让它拍摄左边缘、右边缘、底角和底边缘图片并将其向下吗?我真的希望这是有道理的哈哈。
我不想拉伸图像,因为它会失去分辨率并且看起来很糟糕。
感谢您抽出时间。
Hey all! I'm in the process of setting up my website and I'm trying to find a way to have my background image (or any image) to re-size it self according to content.
My background consist of 4 corners, 4 edges and a fill for the middle. Is it possible to have it re-size? Example of how i want to use it:
My background image currently supports about 4 paragraphs and im at the bottom. What if i want 7-8 paragraphs? Will i have to manually remake the image to be longer or can i have it take the left edge, right edge, bottom corners and bottom edge pictures and and it down? I really hope that made sense haha.
I don't want to stretch the image because it loses its resolution and looks terrible.
Thanks for your time.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不。
使角和边缘分开图像。顶部/底部边缘应可水平平铺;左/右边缘垂直。
然后将“中间”图像作为背景,平铺或以其他方式缩放。 这个答案可能会对您有所帮助。
No.
Make the corners and edges separate images. Top/bottom edges should be tileable horizontally; left/right edges vertically.
Then have a "middle" image as your background that either tiles or is scaled in some other way. This answer may help you there.
您可以使用 css3 属性来做到这一点。并非所有浏览器都支持此功能!
https://developer.mozilla.org/en/CSS/-moz-background -大小
You can do this using css3 properties. Not all browsers support this yet!
https://developer.mozilla.org/en/CSS/-moz-background-size