【发布时间】:2013-03-14 07:56:08
【问题描述】:
我需要在 haml 中对表格列内的下拉菜单进行编码,我还不能对其进行测试,但我想确定我是否对我粘贴的以下 sn-ps 代码做得很好。 这只是悬停时的 CSS 下拉菜单
%thead
%tr
%th.date.header
= "#{t :"date"}"
%a
="#{t :"main_link"}"
%ul
%li
="#{t :"link1"}"
%li
="#{t :"link2"}"
%li
="#{t :"link3"}"
%th.header
= "#{t :"Sports"}"
%th.header
= "#{t :"Event"}"
%th.header
= "#{t :"Media"}"
我还写了 Css 的样子
.date.header ul { display: none}
.date.header ul:hover {display: block}
这是个好方法吗?如何改进?
【问题讨论】:
-
t应该是I18n.t的快捷方式吗?我问是因为= "#{t :"Media"}"可能会引发错误。
标签: css ruby drop-down-menu haml