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;
}
}
Warning: Invalid argument supplied for foreach() in /home/xs208195/y-dsn.com/public_html/wordpress/wp-content/themes/ydsn2023/functions.php on line 264