Text formatting

Text formatting

When filling out Web pages with text formatting in html you have to face more than with other elements and if not for styles , this occupation was long and monotonous. Cascading style sheets with their latest specification CSS 2.0 can set the text to any formatting options. Although there are many textbooks on this topic, but you can approach more easily to this topic. So...

So, using the family family property of HTML, you can specify the font headset. The values ​​are given the name of the font or the list is better in order of priority. You can use font classifications in values: serif (with serifs), sans-serif (without serifs), monospase (monospace), cursive (inclined), fantasy (arbitrary).

Font-size - sets the font size in html. In the values ​​you can specify both numerical values ​​in units of measurement, and use the keywords:

  • Medium - it sets the default font size.
  • Small - 20% less than medium ;
  • X-small - 20% less than small ;
  • Xx-small - 20% smaller than x-small ;
  • Large - 20% more than medium ;
  • X-large - 20% more than large ;
  • Xx- large - 20% more than x-large .

By font, the font will change in HTML using the font-style property and its values: normal ( default ), italic ( italic ), oblique ( oblique ). In terms of thickness, the font adjusts the font-weight property with the values normal ( default ) and bold ( bold ). The height of lowercase letters is formed by font-size-adjust , and if small-casp is used in another font-variant property , the font will be uppercase, and the size will have a lowercase font size.

The intervals between the characters are determined by the letter-spacing property, which is measured in (em) . The interval between words shows - word-spacing . With text-transform, the register is changed by values: capitalize (the first letters of all words are capitalized), lowercase (gives the characters a lowercase), uppercase (forms uppercase characters).

When text is aligned on the page, using html and css, the text-align property with values left , right , center , justufy is applied . Vertically, text alignment can only occur in a table with vertical- align at top , bottom , middle .

When specifying the distance between lines, you will need to use the line-height property, whose values ​​can be measured in any available units, as well as in percentages. At indentation assignments for the beginning of the paragraph, there is an application already text-indent , with the same values.

Formatting the spaces occurs with the white-space property and its three values: normal (the characters of several spaces are converted to one), pre (they will not be converted into one), nowrap (the text will be transferred by special tags).

Text-decoration creates additional attributes to the text in the form of underlines, line-through and overline .

Using CSS, you can also format lists , regardless of their varieties. In the values ​​of the property list-style-type, you can specify the following:

  • Disk, circle, square - a marker in the form of a filled circle, a circle and a painted square, respectively, for a particular list.
  • Lower-roman and upper-roman - numbering of the list with Roman numerals small and large sizes, respectively, for the list to be replaced.
  • Lower-alpha and upper-alpha - numbering in lowercase and uppercase Latin letters.
  • Decimal - list numbering, through CSS, Arabic numerals.
  • None - no numbering and markers for lists.

The list- style -image property allows a small image to be used as a marker. To do this, you must specify its address and name. Example: list-style-image: url ( address / file name )

The offset from the edges is controlled by the list-style -position property with the values inside and outside .

If you have sufficiently learned all the details of the text formatting textbook, then run any HTML editor on your computer. Find there CSS and start from study to practical pursuits.