WordPress CSS Template Core

When you create you own WordPress template, you use custom class and ids and most of the time you forgot that there are CSS class that should be always be present because by default, WordPress use it to center image, align to left or right, and more.

For your convenience, I list down the CSS Core below:

.wp-caption {
    background: #fff;
    border: 1px solid #f0f0f0;
    max-width: 96%; /* Image does not overflow the content area */
    padding: 5px 3px 10px;
    text-align: center;

.wp-caption.alignnone {
    margin: 5px 20px 20px 0;

.wp-caption.alignleft {
    margin: 5px 20px 20px 0;

.wp-caption.alignright {
    margin: 5px 0 20px 20px;

.wp-caption img {
    border: 0 none;
    height: auto;
    max-width: 98.5%;
    width: auto;

.wp-caption p.wp-caption-text {
    padding:0 4px 5px;

You can bookmark this page for your convenience and copy and paste the codes when you need it.

*Some links may contain affiliate links. I may get small commission from your purchases to fund this website and to avoid annoying ads.