Feeds

Alignment of images in post

PerformancingAds
Submitted by sdotson on October 3, 2007 - 4:42pm in

I recently stumbled across Nightlife and it's a gorgeous theme. I am having an issue however. Regardless of how images are aligned in the editor, this theme makes them all aligned to the left. Even if right aligned it pulls the images over to the left. Any ideas?


I'm having the same issues.

I'm having the same issues. A bunch of other formatting that's done in the editor does not come out correct on the actual page. I haven't been able to fix this issue. I thought that the style sheet was telling all images to align left but that doesn't seem to be it.

ACTUALLY! I just found the

ACTUALLY!

I just found the culprit. In the style.css file there is a style calls "#content p img" which has the styling "float: left;"

Delete or comment (/* bla bla bla */) it and now all your images should adhere to the formatting done in the Wordpress editor.

In laymans terms: FIND (in

In laymans terms:

FIND (in www.yoururl.com/yourWPdirectory/wp-content/themes/nightlife/style.css)

#content p img{
float: left;
border: none;
margin-right: 15px;
margin-bottom: 10px;
}

AND CHANGE TO
#content p img{
/*float: left;*/
border: none;
margin-right: 15px;
margin-bottom: 10px;
}

CSS class or ID

Use ".content p img" to declare a class if you have more than one picture
An ID declaration (#) is only allowed once per page!

I would use ".art-img-l" and ".art-img-r" to have two classes for pictures floating right or left in the text. Sometimes an ".art-img-t" for the top picture is useful.

The easiest workaround for the original question is to have a single style declaration for the single picture "img style="float:left;" src="" alt="" width="" height="" /"

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <h2> <h3> <h4> <img> <div> <a> <em> <strong> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <span> <table> <td> <tr> <caption> <th> <hr> <pre> <br> <p> <object> <param> <embed> <strike>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
7 + 3 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.