0
0

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.

【CSS】background-colorが効かない時に試すこと【これかな?】

0
Last updated at Posted at 2020-11-08

background-colorが効かなくて、背景の色が変更できない時ありませんか…?

ということで、backgound-colorが効かない時の対処法を書き留めていきたいと思います。
(色々なケースがあると思うので、随時更新したいと思います。)

【対処法】

  • 幅や高さを指定してみる
  • widthやheightで幅や高さを指定していない場合、CSS的には「え、背景の大きさ指定してないのどこまで塗るの…」と混乱してしまうためではないか、と予想しています。

今回はこの方法で解決されました。

他にもこんなケースがあるよ!というのがありましたらぜひご教示ください:dancer_tone3:
ご自身のQiitaに投稿されている場合は、ぜひ見たいので、リンクもご共有いただけると嬉しいです!

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?