SPECIAL OFFER: Only $69 for access to everything in OSTraining for 1 year! You save $75! 
Join today and get access to 1,000's of books and videos. Learn WordPress, Drupal, Magento, Joomla and more! Sign up today!

Align image next to text inline in html

5 years 11 months ago #120123 by clementlo
Align image next to text inline in html was created by clementlo
Hi,

I need help about the html codes. I want to align an image inline next to html code. I also need to have the image and text to be placed on the centre.

I used JCE editor and it only allow me to align image inline with html only if I align image on the left.

I tried to use div with css to be placed on the centre but no success.

Attached in this forum is the code and the image I intend to have it done.

Can anyone tell me how to do this?

Please advise.

Thanks

This message has attachments images.
Please log in or register to see it.

Please Log in to join the conversation.

5 years 11 months ago #120146 by Valentin
Replied by Valentin on topic Align image next to text inline in html
Hi clementlo,

To aling your image next to your text, check the screenshot below:


I also need to have the image and text to be placed on the centre.

May I have a link of your site and a screenshot explaining this part, please.

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

This message has an attachment image.
Please log in or register to see it.

Please Log in to join the conversation.

5 years 11 months ago #120221 by clementlo
Replied by clementlo on topic Align image next to text inline in html
Dear Valentin,

Thank you for your reply. I did what you have told me but the image ended align to left side.

I want to have the image and test to align next to each other in the middle of the page. However, if I make the image to be in the center, the text was pushed down the image in the center.

I took the snapshot and attached in this forum.

The link to my test webpage is www.test.drclementlo.com

Please advise if it is possible to do so.

Thanks

Regards,
Clement

This message has an attachment image.
Please log in or register to see it.

Please Log in to join the conversation.

5 years 11 months ago - 5 years 11 months ago #120227 by Valentin
Replied by Valentin on topic Align image next to text inline in html
Hi Clement,
I see what you mean.

Replace that paragraph, and use this code instead:
<table style="margin: 0 auto;">
  <tbody><tr>
    <td style="vertical-align: middle;"><img style="" alt="graphics christmas bells 838365" src="/images/graphics-christmas-bells-838365.gif"></td>
    <td style="vertical-align: middle;">Merry Christmas</td>
  </tr>
</tbody></table>

That would give this end result:



Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

This message has an attachment image.
Please log in or register to see it.

The following user(s) said Thank You: clementlo

Please Log in to join the conversation.

Join today and get access to 1,000's of books and videos. Learn WordPress, Drupal, Magento, Joomla and more! Sign up today!