Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 HTML 页面中有这个 date_select 标记:
<%= f.date_select :birthday %>
如何为一天设置一个特定的 CSS 类,为一个月设置一个,为一年设置一个?
您可以通过片段 id 分配 css。假设您的字段返回为“生日”:
#birthday_1i{ /* year */ } #birthday_2i{ /* month */ } #birthday_3i{ /* day */ }