css 继承让我很沮丧
我目前正在制作一个使用 superfish 的菜单。它可以通过 css 完全自定义,但我遇到了一个非常非常令人沮丧的问题。
第二层菜单以某种方式继承了我不知道在哪里的值,无论我做什么改变它都会完全破坏整个布局。看起来文本似乎是比它应该的更靠下的一整行。然而,鼠标悬停样式可以正常工作。
另一个令人沮丧的事情是,我需要将文本从 tier1 菜单项移动到栏的底部 - 到目前为止,我尝试过的所有操作都只是移动了文本,而不是整个项目。如果有人有解决方案,也将不胜感激。
你可以在这里明白我的意思:http://redaxo.witconsult.de/ 它涉及菜单项 2 和 5 (Leistungen & Kontakt) 上的第 2 层菜单,
这是我认为导致该问题的代码: 完整代码在这里: http://redaxo.witconsult.de/files/superfish.css
非常感谢!!!
.sf-menu {
float: left;
margin-bottom: 1em;
}
.sf-menu a {
text-indent: 7px;
}
.sf-menu a, .sf-menu a:visited {
/* visited pseudo selector so IE6 applies text colour*/
color: #333;
}
.sf-menu li { /*///////////// menu lvl 1 /////////////*/
color: #333;
width: 118px;
line-height: 85px;
font-weight: normal;
font-size: 14px;
text-decoration:none;
background: url(../images/menu/menuitem.png);
}
.sf-menu li a:focus, .sf-menu li a:hover, .sf-menu li a:active {
color: #DDD;
line-height: 85px;
background: url(../images/menu/menuitem-mo.png);
}
.sf-menu li li { /*///////////// submenu lvl 2 ///////////////////*/
color: #ddd;
font-size: 12px;
top: 50px;
height: 26px;
background: url(../images/png_black40per.png);
}
.sf-menu li li a:focus, .sf-menu li li a:hover, .sf-menu li li a:active {
color: #333;
line-height: 26px;
background: url(../images/png_white40per.png);
I am currently working on a menu that uses superfish. It is completely customizable via css but I am experiencing a very very frustrating problem.
The 2nd tier menu somehow inherits values from I-know-not-where and whatever I do to change it completely destroys the entire layout. It looks as if the text is somehow an entire line further down then it should be. The mouseover style is working as it should be however.
Another frustrating thing is that I need to move the text from the tier1 menu items to the bottom of the bar - nothing I have tried so far has moved only the text and not the entire item. If anyone has a solution for that it would be greatly appreciated as well.
you can see what I mean here: http://redaxo.witconsult.de/
it concerns the tier 2menues on menu item 2 and 5 (Leistungen & Kontakt)
here is the code I believe is responsible for the problem:
the entire code here: http://redaxo.witconsult.de/files/superfish.css
Thanks a ton!!!
.sf-menu {
float: left;
margin-bottom: 1em;
}
.sf-menu a {
text-indent: 7px;
}
.sf-menu a, .sf-menu a:visited {
/* visited pseudo selector so IE6 applies text colour*/
color: #333;
}
.sf-menu li { /*///////////// menu lvl 1 /////////////*/
color: #333;
width: 118px;
line-height: 85px;
font-weight: normal;
font-size: 14px;
text-decoration:none;
background: url(../images/menu/menuitem.png);
}
.sf-menu li a:focus, .sf-menu li a:hover, .sf-menu li a:active {
color: #DDD;
line-height: 85px;
background: url(../images/menu/menuitem-mo.png);
}
.sf-menu li li { /*///////////// submenu lvl 2 ///////////////////*/
color: #ddd;
font-size: 12px;
top: 50px;
height: 26px;
background: url(../images/png_black40per.png);
}
.sf-menu li li a:focus, .sf-menu li li a:hover, .sf-menu li li a:active {
color: #333;
line-height: 26px;
background: url(../images/png_white40per.png);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了解决您的新问题 - 文本现在位于顶部而不是底部 - 更改锚元素的高度
并添加一些
padding-top
:...如果您无法编辑
superfish.css
,请在其他地方添加类似这样的规则:PS 请更新问题正文以反映问题中的更改;)
In response to your new problem - that the text is at the top now instead of the bottom - change the height of your anchor elements
<a>
and add somepadding-top
:... if you can't edit
superfish.css
add a rule like this one somewhere else:PS Please update the question body to reflect the changes in your question ;)