Sunday, December 23, 2007

"Justify" Is Your Friend

I've been reading a lot of blogs lately that don't use text justification in their posts. If you don't know what this is, shame on you! Using it will space out the words in your post so the right and left sides of your text block (your post) will be even. Most of the time, the default has your text aligned to the left only, thus leaving the right side of your post at the mercy of random line breaks based upon the width of your posting column.

Here's a couple easy ways to fix this.

1) Justifying each post manually
By doing this from your blogging application of choice, you simply go into the screen or tab where you're allowed to edit the HTML of your post directly. With Blogger, for example, you'd click your "Edit HTML" tab.

You can either type your post up before or after doing this, but when you're ready to edit your HTML, you want to wrap your entire post (all text and images too, if you want) in the following manner.

<div align="justify">BLOG POST HERE</div>

2) Using CSS
This is a tad more complicated to begin with, but once its set up, you don't need to remember to add a tag to the actual post, it will happen automatically for every post you create.

Unfortunately, not all blog templates are created equal, so its hard to know exactly what part of the CSS is used to adjust the attributes of your blog posts. Look for something along the lines of posts, main or main wrapper. Once the feature you want to modify has been located, simply add this to the following to the list of attributes.

text-align: justify;

Make sure to always put the semi-colon at the end of every line in the CSS, or it won't rebuild correctly. An example of what the final product will look like is something like this.

.mainwrapper {
margin: 0;
border: 10px solid black;
text-align: justify;
}

Once its all said and done, in my opinion, blog posts will look better and more professional. Its a simple "hack" that improves the overall quality of the blog.

1 comment:

Anonymous said...

what are you trying to say?