When uploading images, you can set alignment to None, Left, Center, or Right. Not all WordPress theme stylesheets have these alignment styles. If you set an image’s alignment to Left, but the image on your page doesn’t appear to be aligned at all, you may need to add a few styles to your theme’s stylesheet.
From the Dashboard, choose Appearance→Editor.
The Edit Themes page opens. All the template files for your active theme are listed on the right side of the page.
Click the Stylesheet template.
The Stylesheet (style.css) template opens in the text box in the center of the page.
Add your desired styles to the stylesheet.
Here are some styles you can add to your stylesheet to make sure that image-alignment styling is present and accounted for in your theme.
Image Alignment | Add This to Your Stylesheet (style.css) |
---|---|
None | img.alignnone class="code">{float:none; margin: 5px 0 5px 0;} |
Left | img.alignleft {class="code">float:left; margin: 5px 10px 5px 0px;} |
Center | img.aligncenter {class="code">display:block; float:none; margin: 5px auto;} |
Right | img.alignright {class="code">float:right; margin: 5px 0 5px 10px;} |
These styles are just examples of what you can do. After learning more about using Cascading Style Sheets (CSS), feel free to get creative with your styling.
dummies
Source:http://www.dummies.com/how-to/content/how-to-add-image-alignment-styles-to-wordpress-sty.html
No comments:
Post a Comment