How to center text, div, or other element using CSS in WordPress

If you are using WordPress for your website, you may want to center a div or other element or item on your website. Just add this WordPress Code Snippet to your CSS stylesheet in your current WordPress theme in order to center a div or other item in WordPress.

 * Center element
 * @author
 * @link
#yourdivname {
	 text-align: center;

Just replace #yourdivname with whatever element, either a id(#) or class(.) that you want to have it’s interior elements centered. Hope this helps with your WordPress problem, enjoy.

   Related Sponsored Links

Disclaimer: The information contained in this website is for general information purposes only and in no event will this site or its owners be liable for any losses or damages associated with your use of our site or content. Click here to see our full Disclaimer.

Leave a Comment