7
9

More than 5 years have passed since last update.

WordPress 投稿(固定ページ)本文欄で使えるタグで作っておいたほうがいいスタイル

Last updated at Posted at 2016-07-22

テーマの style.css で作っておいたほうがいいスタイル。
デザイナーさんにも教えてあげよう。

ソースの例はテーマユニットテストのデータより。
https://codex.wordpress.org/Theme_Unit_Test

theme-unit-test.png

ビジュアルエディタで使える blockquote, pre
ヘッダーやウィジェットなどでも使われ、影響範囲の大きい h1h6, ul, ol
プラグインなどによるビジュアルエディタの拡張で使えそうな table, dl

ソース

Sassです。cssはよしなに。

entry-content.scss
.page-content,
.entry-content,
.mceContentBody {
    // styles in entry-content.
    /* Headings */
    h1 {
    }
    h2 {
    }
    h3 {
    }
    h4 {
    }
    h5 {
    }
    h6 {
    }
    /* Blockquotes */
    blockquote {
    }
    /* Tables */
    table {
        th {
        }
        td {
        }
    }
    /* Definition Lists */
    dl {
        dt {
        }
        dd {
        }
    }
    /* Unordered Lists (Nested) */
    ul {
        li {
        }
    }
    /* Ordered List (Nested) */
    ol {
        li {
        }
    }
    /* Anchor Tag (aka. Link) */
    a {
    }
    /* Preformatted Tag */
    pre {
    }
}

.page-content, entry-content は投稿及び固定ページの本文部分。
.mceContentBody はビジュアルエディタ用。
このクラスの中に入れておくことでヘッダーやフッターサイドバー(ウィジェット)は影響受けない。

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