在Redmine默认主题中扩展长项目标题的标题
我正在尝试调整标准 Redmine 主题来解决页面标题中长项目标题面包屑的包装问题。该问题使得严重嵌套的项目标题显示如下:
我发现了几个 门票 和 董事会帖子涉及类似问题,但没有人提出适当的解决方案。
我想做的是将 #main-menu
保留在 #header
的底部,并在文本时展开 #header
包裹。只需使 #header
大于初始固定的 height
就可以了,但对于短标题来说看起来有点奇怪。有没有一种好的方法可以在不完全重新设计标题的情况下做到这一点? (这是我的后备想法)。理想情况下,我也想在不从列表中删除项目的情况下执行此操作。
我认为 Redmine 官方网站 上的布局使用相同的 CSS 和 HTML 供参考,但相关位是:
HTMLCSS
<div id="header">
<div id="quick-search"></div>
<h1>
<a href="" class="root">Test Project</a> » … »
<a class="ancestor">Really long project title 2</a> »
<a class="ancestor">Really long project title 3</a> »
Really project title 4
</h1>
<div id="main-menu">
<ul>
<li>...</li>
...
</ul>
</div>
</div>
#header {
height: 5.3em;
margin: 0;
padding: 4px 8px 0px 6px;
position: relative;
}
#main-menu {
position: absolute;
bottom: 0px;
left: 6px;
margin-right: -500px;
}
I'm trying to adjust the standard Redmine theme to solve a problem with wrapping of long project title breadcrumbs in the page header. The problem makes heavily nested project titles show up like this:
I've found a couple of tickets and board posts about similar issues, but nobody with a proper resolution for it.
What I'm trying to do is keep #main-menu
at the bottom of #header
, and to have #header
expand when the text wraps. Just making #header
larger than the initial fixed height
works, but looks a bit odd for short titles. Is there a nice way of doing this without completely restyling the header? (that's my fallback idea). Ideally I'd also like to do it without just removing items from the list.
I think the layout on the official Redmine site uses the same CSS and HTML for reference, but the relevant bits are:
HTML
<div id="header">
<div id="quick-search"></div>
<h1>
<a href="" class="root">Test Project</a> » … »
<a class="ancestor">Really long project title 2</a> »
<a class="ancestor">Really long project title 3</a> »
Really project title 4
</h1>
<div id="main-menu">
<ul>
<li>...</li>
...
</ul>
</div>
</div>
CSS
#header {
height: 5.3em;
margin: 0;
padding: 4px 8px 0px 6px;
position: relative;
}
#main-menu {
position: absolute;
bottom: 0px;
left: 6px;
margin-right: -500px;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这在 Chrome 中对我有用。没有在其他地方测试过。
将
header div
中的div
更改为浮动,如下所示您可能需要调整宽度。
还要在
main menu div
之后、header
的之前添加
br
删除
#header div
上的height
This works for me in Chrome. Not tested elsewhere.
Change the
divs
in theheader div
to floats as followsYou may need to fiddle with the widths.
Also add a
br
after themain menu div
but before the</div>
for theheader
Remove the
height
on the#header div