CSS 下拉菜单
我正在学习设计下拉菜单的样式并有几个问题。
您可以在此处看到下拉菜单: http://jsfiddle.net/tomperkins/3M7Cb/
我的问题是:
如何获得向下箭头 出现在每个父项上(当我 尝试更换背景 属性)。
怎样才能得到整个孩子 可点击的区域,而不是 只是文本本身?
一如既往,非常感谢所有帮助。
提前致谢,
汤姆·帕金斯
I'm learning to style a dropdown menu and have a couple of questions.
You can see the dropdowns here: http://jsfiddle.net/tomperkins/3M7Cb/
My questions are:
How can I get a down arrow to
appear on each parent item (when I
tried it replaced the background
properties).How can I get the whole child
area to be clickable, rather than
just the text itself?
As always, all help really appreciated.
Thanks in advance,
Tom Perkins
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于向下箭头,我倾向于使用文本对象而不是图像:
为了使整个
li
可点击:这两个建议的 JS Fiddle 演示。
编辑调整向下箭头的悬停样式:
JS Fiddle demo
For the down arrow, my inclination is to use a text-object rather than an image:
To make the whole
li
clickable:JS Fiddle demo of both suggestions.
Edited to adjust the hover style of the down-arrow:
JS Fiddle demo
问题2>您的
标记需要呈现为占据下拉项区域的块。由于您使用专门的工具来构建这些菜单,我猜测有一个配置设置(或类似的)可以让您进行设置。
question 2> your
<a>
tag needs to be rendered as a block that takes up the area of the dropdown item. Since you are using a specialized tool to build these menus, I'm guessing there is a config setting (or similar) that allows you to set this up.