| In this small tutorial I will explain the rules to apply CSS to the texts. There are few, and I will concentrate on the most used, but I did not want to skip them. |
| |
TEXT-INDENT < valor >
|
| This property allows us to specify the indentation of the first line of text in a block (the space that exists to the left of the first line, regarding the others). |
| The values that can take are: |
|
< measure > |
|
In this way, it specifies a set amount, either in pt, px, em ... |
|
< percentage > |
|
So the space will depend on the size of the block containing it, ie if we apply a rate of 20%, that means the first line will move to the left 20% regarding its block container. |
| |
|
| This property is very well understood in the following example. |
| Take a html file with the following structure: |
 |
| In this case, if we execute the code EXAMPLE , We will see two paragraphs in white and two yellow. So far everything seems normal. But if we put the browser in windowed mode, and reducing it and expand the right side with the mouse, dragging the left button pressed, you can clearly verify that the indentation of white paragraphs is always the same (fixed measure) and the yellow paragraphs varies. This is because each time you vary the size of the browser, the text-indent property recalculates the percentage of indentation regarding the new size of the object that contains the paragraphs. |
| NOTE: This property is inherited from parents to children, and so if you do not want this indentation to appear in blocks children, you must place a TEXT-INDENT: 0px; in the blocks children. |
| |
TEXT-ALIGN < valor >
|
| With this property we aligned the text with respect to the block that contains it. |
| The values that can take are the following: |
|
left, right, center, justify |
|
I believe that it is very clear. In case there are doubts with justify,what it does is to justify the text on both sides of the block that contains it, inserting between the words of each line the spaces that are necessary to it. |
| |
|
| The best explanation is the following example. We put a file HTML with the following structure: |
 |
| In this case, if we execute the code EXAMPLE , we will see clearly the effect of each value. The first block is aligned to the left, because it is the default mode. It is also interesting to test in windowed mode with the width of your browser to see how it the text will adjust. |
| NOTE: This property is inherited from father to son. |