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 3 years have passed since last update.

リセットCSSでuser agent stylesheetが消せない時の解決方法

Last updated at Posted at 2020-05-04

どういう状況

YUI 3.5.0 - reset.cssを使用したけれど、ブラウザ初期に設定されているCSSを一部消せませんでした(下記のもの)

user_agent_stylesheet(この表示はgoogleの検証画面にあります)
li {
    display: list-item;
    text-align: -webkit-match-parent;
}

解決方法

各項目について、_reset.scssにinherit属性を追加することにより解決できました。

src/public/resources/sass/_reset.scss
li{
  text-align:inherit;
  display:inherit;
}

参考

後日談

打ち消せた項目でもbootstrapとして効いている場合は、結局打ち消した項目の再設定が不可能だったため、cssファイルを分けて、app.cssを読み込まないで該当ファイル(例: user.css など)だけを読み込ませることでうまくいきました。

何かの参考にしていただければと思います。

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?