固定ページをブラウザで表示して、右クリックで「ソースを表示」とかで次のようなcssファイルを参照するためのタグを探して、それをHEADタグ内にコピーしてみてください。
<link rel="stylesheet" type="text/css" href="hoge.css" />
▽2
●
a-kuma3 ●200ポイント ベストアンサー |
実物を見ていないので、あくまでも想像ですが、
の、どちらかが原因だと思います。
使っているテーマによって違うのかもしれませんが、例えば、twentyeleven の style.css から適当に抜粋すると、こんな感じ。
.singular .entry-header, .singular .entry-content, .singular footer.entry-meta, .singular #comments-title { margin: 0 auto; width: 68.9%; } ... .singular.page .hentry { padding: 1.625em 0 0; }
それほど階層が深いセレクターにはなっていませんが、それでも 2?3段くらいの階層を指定したスタイルがたくさんあります。
その、直接 コンテンツを書き込んだというページを実際に見られると、もっと具体的な回答が付くと思います。
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; vertical-align: baseline; } h1, h2, h3, h4, h5, h6 { clear: both; } .site-header h1, .site-header h2 { text-align: center; } .site-header h1 { font-size: 24px; font-size: 1.714285714rem; line-height: 1.285714286; margin-bottom: 14px; margin-bottom: 1rem; } .entry-content h1, .comment-content h1, .entry-content h2, .comment-content h2, .entry-content h3, .comment-content h3, .entry-content h4, .comment-content h4, .entry-content h5, .comment-content h5, .entry-content h6, .comment-content h6 { margin: 24px 0; margin: 1.714285714rem 0; line-height: 1.714285714; } .entry-content h1, .comment-content h1 { font-size: 21px; font-size: 1.5rem; line-height: 1.5; } article.format-aside h1 { margin-bottom: 24px; margin-bottom: 1.714285714rem; } article.format-image footer h1 { font-size: 13px; font-size: 0.928571429rem; line-height: 1.846153846; font-weight: normal; } .format-status .entry-header h1 { font-size: 15px; font-size: 1.071428571rem; font-weight: normal; line-height: 1.6; margin: 0; } .site-header h1, .site-header h2 { text-align: left; } .site-header h1 { font-size: 26px; font-size: 1.857142857rem; line-height: 1.846153846; margin-bottom: 0; } .site-header h1 { font-size: 21pt; line-height: 1; text-align: left; }
見てわかるように、直接 タグだけを指定したスタイルは、マージンやパディングをキャンセルしたものと float のクリアだけで、その他の設定は、何かのクラスを指定した要素の内側にある H1 に対して定義されています。
page.php に直接 書いた H1 は、その親の要素にクラスが指定されていないから、編集画面からの書き込みと見た目が違うのでしょう。
<h1> これでは、投稿と同じスタイルには、ならない。 </h1> <div class="entry-content"> <h1> class="entry-content" な要素の内側に書かれた H1 に、スタイルが反映される。 </h1> </div>
スクリーンショットではなくて、そのページが見られる URL を示せるなら、もっと具体的に回答できると思います。
すみません、説明不足により誤解をまねいている感がありますので、以下追記させてください。
実際に、固定ペ?ジの「編集画面」からの投稿と、固定ペ?ジファイル(page.php)に直接書き込みを行ってみました(その時のスクリ?ンショットが以下です)。
http://f.hatena.ne.jp/ykhpno1/20140803093037
http://f.hatena.ne.jp/ykhpno1/20140803093038
どちらも文章を<h1></h1>で囲んであります。
その結果のスクリ?ンショットが以下です。
http://f.hatena.ne.jp/ykhpno1/20140803093039
この違いはどのテ?マでも起こることで、実際にデフォルトテ?マで試しました(Twenty Twelve)。
この現象を質問させていただいたのですが、言葉足らずでした、
(回答者さま申し訳ございません)
この現象がwordpressの仕様であることは理解しているのですが、固定ペ?ジファイル(page.php)に直接書き込みした場合でも、編集画面からの書き込みと同じようにスタイルシ?トを適用したいのです。
その方法をご存知の方、教えてください、お願いいたします。