LoginSignup
0
0

More than 5 years have passed since last update.

Haml/scssで文字の色や位置が反映されなかった時の対処事例

Last updated at Posted at 2017-04-12

class名に%は必要なかった

hamlにもscssにもclass名を%header__messageと記入し、SCSSを使おうと思っていたが動かず立ち往生していた。

そこで%を取ってみると、動いた。

%header
  %header__message
    メッセージ

↓↓↓

%header
  .header__message
    メッセージ
header__message{
  text-align: center;
  color: $white;
  line-height: 2
}

↓↓↓

.header__message{
  text-align: center;
  color: $white;
  line-height: 2
}

headerやpには%が必要だがclassやdivには必要ないということでした。

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