?
Solved

Wordpress CSS question

Posted on 2012-03-27
1
Medium Priority
?
663 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 2000 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

Industry Leaders: 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

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.
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses
Course of the Month14 days, 18 hours left to enroll

771 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