Updated: August 17, 2021
Ever notice that some of your sidebar images, blog buttons, custom HTML items, etc., are centered and some aren’t? It makes your sidebar look uneven. If you are like me, you want your sidebar content aligned the same, either all centered, all left or all right. I’m going to show you how!
The Wrong Ways to Align
Let’s go over the way wrong ways to align content, especially centering. How to center align is the most looked up or wanted alignment for content on the sidebar. The following are the most commonly used but are “depreciated” methods that are no longer supported and do not comply with web standards. These methods may still work on some web browsers but the results are not guaranteed.
<center>This code no longer supported, but does work in some browsers.</center>
<div align="center">This code no longer supported, but does work in some browsers.</div>
The Correct Ways to Align
First, the best way to make sure your sidebar content will all be centered is by having it CODED directly into the CSS of your blog or website by your web designer (that would be me, or your own designer). However, to avoid extra fees that would be charged to have it changed, I am going to show you an accepted alternative that you can use on your sidebar to keep your content centered; or change it to right or left aligned, however you want it.
Center Align:
Replace the below line in red with your content.
EXAMPLE:
<div style="text-align:center">
Your text, HTML or widget code will be centered.
</div>
Left Align:
Replace the below line in red with your content.
EXAMPLE:
<div style="text-align:left">
Your text, HTML or widget code will be left aligned.
</div>
Right Align:
Replace the below line in red with your content.
EXAMPLE:
<div style="text-align:right">
Your text, HTML or widget code will be right aligned.
</div>
And that’s all there is to it! If you have any questions, please contact me!
If you want your sidebars to be aligned the correct and code standard way, please contact me and I’ll be happy to give you a quote for a quick update for your sidebar alignment.