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!
Read more:
- Check out ALL my » Blogger Resources «
- November Goals
- Blogtober 2017 Post Archive
8 Comments
Thank you this is so helpful!
Glad it was helpful Katie! xx
This was helpful! I thought it center aligned automatically but I guess not. So I’ll have to use this.
http://sugarcoatedbears.blogspot.com/
They don’t and its really annoying haha! xx
Very helpful, will be bookmarking this for future 🙂 x
Thanks Laura! xx
This was very helpful. Thanks for sharing!
http://www.onyixtus.com
Glad it was helpful!