post-contentの中の最低限用意しておきたいCSS

post-contentの中の最低限用意しておきたいCSS

本文が出力される部分に適用しておきたい最低限のCSS

画像用

.post-content img.aligncenter {
display: block;
margin: 0 auto;
}
.post-content img.alignright {
display: block;
margin-left: auto;
margin-right: 0px;
}
.post-content img.alignleft {
margin-left: 0px;
display: block;
margin-right: auto;
}
.post-content img[class*=”wp-image-“],
.post-content img[class*=”attachment-“] {
height: auto;
max-width: 100%;
}

文字用

.post-content strong {
font-weight: bold;
}
.post-content em {
font-style: italic;
}
.post-content blockquote {
display: block;
-webkit-margin-before: 1em;

-webkit-margin-after: 1em;
-webkit-margin-start: 40px;
-webkit-margin-end: 40px;
}

後はPCとSPのメディアクエリにそれぞれの差分を追記

@media (min-width:768px), print {
.post-content p {
margin: 30px 0;
}
.post-content p:last-of-type {
margin-bottom: 0;
}
}

@media (max-width: 767px) {
.post-content p {
margin: 15px 0;
}
.post-content p:last-of-type {
margin-bottom: 0;
}
}

ホームページ制作の
お問い合わせ

Y desIgnのサービスは全国対応可!

全国
対応

遠方の企業様にLINEやzoomなどのビデオ会議ツールを活用させていただくことで日本全国のお客様へのサービス提供を可能としております。

ホームページを作りたいと
お伝えください

受付時間
平日火曜~金曜 10:00~17:00

0586-52-5113