Monday, January 10, 2005

Code Tricks... #01 Text Indents Using DIV Tags

I am starting a new series of entries called Code Tricks. The purpose of these entries will be to provide neat or interesting tricks to assist with HTML, JavaScript, or Template layouts.

The first entry will deal with creating indented margins. Many bloggers use <blockquote>Text To Be Indented </blockquote> tags to enable insertion of indented text into their blog posts. The attributes of these quote areas are usually specified with a CSS style definition. These are global definitions and are defined within your template or a separate CSS include file that your HTML imports.

To define on the fly indentations, use the following technique:
<div id="ex" style="margin-left: 10%; margin-right: 10%;">Text To Be Indented </div>.

This code can be inserted directly in your blog post or specified in the HTML file.

<> Example <>

Without DIV Tags:
Now is the time for all good people to come to the aid of the Tsunami Relief Efforts...

With DIV Tags Using 10% Margins - as shown above:
Now is the time for all good people to come to the aid of the Tsunami Relief Efforts...



For future reference, searching this Blog (see above illustration and sidebar) with the search query "Code Tricks" will retrieve this group of entries.

0 Comments:

Post a Comment