Basic CSS rules for development of WordPress themes

Whenever you are developing the new wordpress theme, you need to put some css in your style.css file. If you are not adding that css in your theme then there is a lot of changes to break your theme view.

Some classes which are needful for image and alignment purpose. You need to just copy paste following CSS code in your style.css file.

.aligncenter,

div.aligncenter {

display: block;

margin-left: auto;

margin-right: auto;

}

.alignleft {

float: left;

}

.alignright {

float: right;

}

.wp-caption {

border: 1px solid #ddd;

text-align: center;

background-color: #f3f3f3;

padding-top: 4px;

margin: 10px;

/* optional rounded corners for browsers that support it */

-moz-border-radius: 3px;

-khtml-border-radius: 3px;

-webkit-border-radius: 3px;

border-radius: 3px;

}

.wp-caption img {

margin: 0;

padding: 0;

border: 0 none;

}

.wp-caption p.wp-caption-text {

font-size: 11px;

line-height: 17px;

padding: 0 4px 5px;

margin: 0;

}

You can edit some CSS as per theme requirement also.

Following CSS classes are also useful for creating the WordPress theme. You can create these CSS classes as per your theme requirement.

.categories {…}

.cat-item {…}

.current-cat {…}

.current-cat-parent {…}

.children {…}

.pagenav {…}

.page_item {…}

.current_page_item {…}

.current_page_parent {…}

.current_page_ancestor {…}

.widget {…}

.widget_text {…}

.blogroll {…}

.linkcat{…}

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

2 thoughts on “Basic CSS rules for development of WordPress themes”

Leave a Reply

Your email address will not be published.