选择多个背景图片 [英] Select multiple with background image

查看:90
本文介绍了选择多个背景图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,这笔交易。我有一个带背景图像的< select multiple> 标签。
所以现在每当我向下滚动时,背景图片都不会随文本一起移动。我得到这个效果:





左图是前,右图是我滚动后的图片

当我向下滚动时,我希望它向上移动。所以每条线都保持相同的颜色。



有关我该怎么做的任何建议?

解决方案

不是你的问题的答案,但是不是为每个选项选择一个单独的背景颜色更好吗?



原始JSFiddle示例



背景图像方法必然会失败,例如如果用户增加字体大小。


Alright here's the deal. I have a <select multiple> tag with a background image. So now whenever I scroll down, the background image does not move up with the text. And I get this effect:

The left pic is before and the right is after I scroll

I want it to move up when I scroll down. So that each line stays with the same color.

Any suggestions on how do I do that?

解决方案

Not an answer to your question, but wouldn't it be more desirable to give each option an individual background colour instead?

Primitive JSFiddle example

The background image approach is bound to fail e.g. if the user increases the font size.

这篇关于选择多个背景图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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