How to Align Images in Your WordPress Blog

When you upload your image to your WordPress blog or website, you can set its alignment as None, Left, Center, or Right. The WordPress theme you’re using, however, may not have these alignment styles accounted for in its stylesheet. If you set the alignment to Left, for example, but the image on your blog doesn’t appear to be aligned at all, you may need to add a few styles to your theme’s stylesheet.


To make sure that you have the correct image alignment for your newly uploaded images, follow these steps for a quick-and-dirty method:



  1. Click Editor in the Appearance drop-down list.


    The Edit Themes page opens. All the template files for your active theme are listed on the right side of the page.



  2. Click the Stylesheet template.


    The Stylesheet (style.css) template opens in the text box on the left side of the page.



  3. Add your desired styles to the stylesheet.




The following table shows the styles you can add to your stylesheet.























Image AlignmentAdd This to Your Stylesheet (style.css)
Noneimg.alignnone {float:none; margin: 5px 0 5px
0;}
Leftimg.alignleft {float:left; margin: 5px 10px
5px 0px;}
Centerimg.aligncenter {display:block; float:none;
margin: 5px auto;}
Rightimg.alignright {float:right; margin: 5px 0
5px 10px;}

These styles are just examples of what you can do. Get creative with your own styling.




dummies

Source:http://www.dummies.com/how-to/content/how-to-align-images-in-your-wordpress-blog.html

No comments:

Post a Comment