5
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Bootstrap4 hoverした時のリンクの背景色を変えたい

Last updated at Posted at 2019-01-26

##はじめに

RailsでBootstrap4.1.1を使用中に遭遇

##追記
scaffoldingで作成した際に自動生成されるcssファイルが原因でした。。
cssファイルを削除すれば直りました。

スクリーンショット 2019-01-26 20.15.41.png

リンクにカーソルを合わせると(hoverすると)背景色が黒くなっててジーザスクライス


app/assets/stylesheets/application.scss
a:hover {
  background-color: transparent;
}

aタグにhoverさせると背景色が透明になるように上書き
(Railsだとlink_toメソッドはaタグに変換される)

スクリーンショット 2019-01-26 20.35.44.png

これで解決!

5
7
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
5
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?