如何在单行突出显示的行上实现多个图像按钮
我正在制作一个用户界面,我希望每条线在滚动时都能响应颜色效果,以给定的颜色为该特定线的整个背景着色。 此外,每行应包含几个小符号(按钮),这些符号也应响应用户的单击和鼠标悬停。
我知道使用锚标记来做到这一点的唯一方法,但是一旦我使用了它,我就无法在其中嵌套另一个锚。 有没有办法生成“嵌套按钮”或解决方法(最好不包括javascript)来实现我的目标?
马拉尔布约
I am making a user interface where I want each line to respond with a color effect when rolled over, coloring the entire background of that particular line in a given color. In addition, each line should contain several small symbols (buttons) that also should respond to user clicks and rollovers.
The only way I know to do this using the anchor tag, but once I have used that, I cannot nest another anchor within it. Is there a way to produce "nested buttons" or a workaround (preferrably not including javascript) to accomplish my goal here?
maralbjo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的 CSS 文件可能包含:
您的 HTML 文件可能只有一个项目列表:
Your CSS file could contain:
Your HTML file could then just have a list of items:
如果不编写脚本,则无法使其在旧版 IE 浏览器中运行。 :(
我最终做了 Dmitri Farkov 在他的评论中提出的建议:通过脚本添加悬停行为。不过,我使用了一段时间的一个有趣的替代方案: whatever:hover。
也许它更适合您。
You cannot make it work in older IE browsers without scripting. :(
I ended up doing what Dmitri Farkov proposed in his comment: adding hover behavior via script. There is an interesting alternative I used for a while, though: whatever:hover.
Maybe it will suit you better.