とても初歩的な質問です、すいません。
現在Viewがこんな感じで、
エラーが起こると見ての通り改行されて元のテキストボックスの位置が変わります。
エラーが出ても画面固定で表示させたいのですが、どうすればよろしいでしょうか?
どうかよろしくお願いいたします。
//index.html.slim .wrapper_register .register_image = image_tag("register/register_main.jpg", :style => "width: 100%; height: 100vh; max-width:100%; max-height:100%;") .register_font_area .register_font Sign Up .register_form_area .register_form = form_for(@user, url: register_index_path) do |f| .register_form_font_top ニックネーム = f.text_field :name, :class => 'register_text_form' - if @user.errors.include?(:name) .register_text_form style= "color: red; font-size: 12px; opacity: 0.7" = @user.errors.messages[:name].join('、 ') .register_form_font メールアドレス = f.text_field :email, :class => 'register_text_form' - if @user.errors.include?(:email) .register_text_form style= "color: red; font-size: 12px; opacity: 0.7" = @user.errors.messages[:email].join('、 ') .register_form_font パスワード = f.text_field :password, :class => 'register_text_form', :type => "password" - if @user.errors.include?(:password) .register_text_form style= "color: red; font-size: 12px; opacity: 0.7" = @user.errors.messages[:password].join('、 ') .register_form_font パスワード確認 = f.text_field :password_confirmation, :class => 'register_text_form', :type => "password" - if @user.errors.include?(:password_confirmation) .register_text_form style= "color: red; font-size: 12px; opacity: 0.7;" = @user.errors.messages[:password_confirmation].join('、 ') .register_submit_outer = submit_tag "登録する", :class => "register_submit_inner", :id => "submit" .or | or #{link_to "アカウントをお持ちの方はこちら", login_path, :style => "font-size: 14px; text-decoration: underline; color: #bdbdbd "}
//register.scss // Place all the styles related to the top controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ .wrapper_register { display: flex; flex-direction: row; width: 100%; height: 100vh; } .register_image { width: 100%; height: 100vh; } .register_font_area { width: 100%; height: 100vh; position: absolute; } .register_font { display: flex; position: relative; color: #f54141; font-size: 100px; font-weight: 70; font-family: "HiraKakuProN-W6", "Arial Black"; width: 50%; padding-left: 20px; } .register_form_area { position: absolute; width: 39.5%; top: 9%; left: 57.5%; } .register_form { width: 90%; height: 100%; position: absolute; top: 5%; left: 4.5%; } .register_text_form { width: 100%; background-color: transparent; border-top: 0; border-right: 0; border-left: 0; border-radius: 0; height: 35px; } input:-webkit-autofill { box-shadow: 0 0 0 1000px rgb(224, 224, 224) inset; } .register_text_form:focus { outline: 0; background-color: rgba(255, 255, 255, 0.1); } .register_form_font_top { color: black; margin-top: 30px; font-weight: bold; } .register_form_font { color: black; margin-top: 25px; font-weight: bold; } .register_submit_outer { margin-top: 40px; text-align: center; } .register_submit_inner { background-color: transparent; padding: 7px 0px; position: absolute; width: 50%; cursor: pointer; border: 1px solid #000000; box-shadow: 0 0 35px rgba(0, 0, 0, 0.5); left: 0%; } .register_submit_inner:hover { background-color: rgba(255, 255, 255, 0.3); } .or { padding-left: 52%; color: #bdbdbd; padding-top: 1%; font-size: 20px; margin-top: 10%; } div.field_with_errors .form-control { background-color: rgba(255, 0, 0, 0.2); }
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/01/12 13:13