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 1 year has passed since last update.

【Gatsby】MDXにむりやりスタイルを付ける

Posted at

以下はmdx。jsxで記述した箇所にスタイルを充てるのは簡単だけど、「# Header」の箇所にスタイルを充てるのはなんか色々設定する必要がある。

---
title: "Second Post"
date: "2021-07-25"
---

import "./style.css"


# Header1

<div style={{ padding: "10px 30px", backgroundColor: "tomato" }}>
    <h2>Try making this heading have the color tomato</h2>
</div>

F12で見てみると、「# Header」の箇所には、id="Header"がついているので、cssでそこにスタイルを付けられる。

#Header{
  background-color:red;
}
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?