Text formatting in HTML

Alignment and Spacing

Why stick to the left...

When you can hang out in the right...

or just chill in the center?


Want to know how to change the aligment of your text like that? It's simple! For having your text stick to the left, you just leave it as normal text. The left is default. If you want your text on the right, you'd use &ltp align=right> top open the tag and <p> to close the tag. Center is really simple. You just use &ltcenter> to open the tag, and <center> to close it.

Ever noticed how when you write an HTML document with, all your carriage returns seem to be gone when you veiw the page in your web browser? That's because you need special tags for these. To do carriage returns, you use &ltBR>. The &ltBR> tag is a little funny, because unlike most tags, it doesn't need a closing tag.

Another way to do this, instead of &ltBR> is using the &ltp> and <p> tags. Just put the opening P tag at the top of your paragraph, and the closing one at the bottom. These are the same as 2 BR tags.

Another way you can do formatting is using the &ltpre> tag. It gives you preformatted text, so [TAB] indents and carriage returns work. Remember to close it with <pre>.

That brings this tutorial to an end. I hope it has been helpful. If you want to ask me questions or comment on this tutorial, you can e-mail me at [email protected].

You might also like...

Comments

About the author

Jamie Lindgren United States

Uhm... I dunno why I'm typing this, cuz nobody is gonna read it probably, but anyway... I am (guess my age!! haha... 14) years old and I like programming, web design, and graphic design. I'm ...

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There are 10 types of people in the world, those who can read binary, and those who can't.”