1
1

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.

!importantが最優先されない。なぜ?

Posted at

文章全体を中央揃えしようとしています。
しかし、style内に入れている!importantでなぜか最優先されません。
idやclassはstyle内で対応してありますが省略。
!importantはここしか書いてません。
また、

margin:0 auto;

でも試しましたが、できませんでした。なぜでしょうか?

naze.html
<head>
<style>
 p { text-align: center !important; }
</style>
</head>

<body>
<section id="main">
 <h1>ほのかの挨拶</h1>
 <p class="item">ジャンボだよ!</p>
</section>
<section id="sub">
 <h2>まきちゃんの挨拶</h2>
 <p>アニョハセヨー!</p>
 <ul>
  <li>live</li>
  <li>live</li>
  <li>live</li>
  <li>live</li>
  <li>live</li>
  <li>live</li>
  <li>live</li>
 </ul>
</section>
</body>
1
1
8

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?