How many times have you wanted to include a social media post on your blog but find you can’t get it to center align? I have been frustrated with this issue so many times. Usually, my blog post images cover the entire width of my post area, but social media embed posts usually don’t. I find it looks really odd when they are aligned to the left, which is how they align if you put the embed code into your post. Here are the ways in which you can align your embed posts, text and images to the center.
For each method, you will need to locate how to view your post in its HTML form.
- In WordPress there is a tab next to ‘visual’, you will need to select the ‘text’ tab.
- In Blogger, I believe there is a tab that says HTML view (or similar).
How to center align social media embed posts
Center align – method 1:
This is the basic HTML code which will change almost anything to center in the middle of your post area. As I found this technique does not work for Instagram posts. In which case you will need the code I share in method 2.
<center>Text or image here </center>
You can just use the align options in your post editor, but this is useful if you want something to align differently with the rest of the text. I find sometimes that items get ‘stuck’ in a position and this code helps move the item.
Center align – method 2:
If you find the above code does not work, this one will. If it is an embed code in particular that you are trying to center, go and get your code first and paste it into your HTML view of your post editor. Then you will need to put the below code around the one you have just pasted into your editor.
<div align=”center”> embed code here </div>
There you have it, your embed social media posts should now be center aligned.
Please leave a comment if there is something you would like to know how to do!