Solved

Wordpress CSS question

Posted on 2012-03-27
1
660 Views
Last Modified: 2012-03-27
Hi Experts,

I did a custom theme for a WP site and when I add an image in wp page editor and choose right align it appears fine in the editor but when I preview the page it's left aligned.

Seems that it's following the <p> tag left align property and my custom CSS doesn't have the styles to do the image alignment needed by the editor.  (alignright size-medium wp-image-150)

where are these apparently default styles typically found?  Is there some default style sheet or style that are to be included in all themes?

i.e.:  <a href="http://website.ca/wp-content/uploads/2012/03/stock-photo-13325752-woman-smile.jpg"><img class="alignright size-medium wp-image-150" title="stock-photo-13325752-woman-smile" src="http://website.ca/wp-content/uploads/2012/03/stock-photo-13325752-woman-smile-300x206.jpg" alt="" width="300" height="206" /></a>

Thanks,

HNM
0
Comment
Question by:HelpNearMe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 12

Accepted Solution

by:
Tony van Schaik earned 500 total points
ID: 37773860
This is the default CSS code that Wordpress uses, just add them to your stylessheet and change it to your needs:

img.alignright {float:right; margin:0 0 1em 1em}
img.alignleft {float:left; margin:0 1em 1em 0}
img.aligncenter {display: block; margin-left: auto; margin-right: auto}
.alignright {float:right; }
.alignleft {float:left; }
.aligncenter {display: block; margin-left: auto; margin-right: auto}

Open in new window


More info on that can be found here:

http://codex.wordpress.org/Wrapping_Text_Around_Images
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question