LoginSignup
1
1

More than 5 years have passed since last update.

ボタンを中央揃えにする

Last updated at Posted at 2019-01-18

ボタンを中央揃えにする

キャンセルボタンと一括編集ボタンを中央揃えにしたかったのでメモ。

html側

<div class ="update_all">

<button class = "button-update-all"><%= link_to "キャンセル", aaa_path(@user, id: current_user.id), style:"width:300px", class: "btn btn-primary", data: { confirm: "保存しないでよろしいですか?" } %></button>

<button class = "button-update-all"><%= f.submit "編集を保存する", style:"width:300px", class: "btn btn-primary", data: { confirm: "更新してよろしいですか?"} %></botton>

</div>

css側

divクラス

.update_all {
 text-align: center;
}

buttonクラス

.button-update-all {
  border: none;
  background: none;
}

を指定すると出来ました。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1