gpt4 book ai didi

css - rails : how to style submit tag with custom css

转载 作者:技术小花猫 更新时间:2023-10-29 11:28:20 25 4
gpt4 key购买 nike

下面的代码创建了一个表单,并根据一些 css(“按钮”)设置了“提交”按钮的样式。问题是,当页面呈现时,它会在自定义“按钮”css 顶部显示正常的 rails 提交标记按钮。如何静音或禁用 Rails 提交标签按钮的视觉效果,同时仍使其提交表单?

=form_tag new_site_url, :method => :get do
=text_field_tag :homepage,'', type: "text", class: 'text'
%button
=submit_tag "GO!"

最佳答案

你能做到吗:

=form_tag new_site_url, :method => :get do
=text_field_tag :homepage,'', type: "text", class: 'text'
=submit_tag "GO!", class: 'button'

并为按钮设置css样式?

最好这样做:

=form_tag new_site_url, :method => :get do |f|
=f.text_field '', type: "text", class: 'text'
=f.submit "GO!", class: 'button'

关于css - rails : how to style submit tag with custom css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11616887/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com