Solved

Wordpress CSS question

Posted on 2012-03-27
1
644 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

773 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