html - 左侧重复的纹理和右侧重复的纹理

标签 html css background-image repeat

我不知道该怎么做,但我想要 2 个重复纹理,一个向左重复,一个向右重复。

代替:

#header {
   background-image : Url('My_Two_Textures_Combined.png');
   background-repeat : repeat-x; /*Which repeats my joined textures a long the x axis*/
}

我愿意:

#header {
   background-image : Url('My_Left_Texture');
   background-repeat : repeat-x-left; /*Which would ideally repeat my texture to the left on the x axis*/
   background-image : Url('My_Right_Texture');
   background-repeat : repeat-x-Right; /*Which would ideally repeat my texture to the right on the x axis*/
}

我希望有办法做到这一点,因为我认为它在我的网站上看起来不错。我将尝试寻找其他方法来执行此操作,例如使用伪命令或其他方法。如果我找到任何东西,我会张贴在这里!

最佳答案

:before 和 :after 是一个很好的解决方案,但您始终可以使用 CSS3 查看多个背景。显然,支持也有一些限制:> IE8,但这也可以解决问题。

background-image: url(left.png), url(right.png);
background-position: left bottom, right bottom;
background-repeat: no-repeat;

关于html - 左侧重复的纹理和右侧重复的纹理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12711776/

相关文章:

html - 手机背景图片失真

html - 具有透明度的 CSS、HTML 叠加背景

css - 如何找到图像 URL 以放置背景图像?

javascript - 使用 JavaScript 更改背景图像

javascript - 背景进度条 Canvas

JQuery toggleClass 和 slideToggle - toggleClass 的行为不正确

css - 不透明度不适用于 IE8 中的图像

javascript - 从数组中删除元素并更新表

Javascript为客户端实现拖拽框

Javascript GPA 计算器,计算按钮不起作用