How to insert a space into html

How to insert a space into html

The space insert in html is necessary for correct display of the text on the web page according to the effects conceived by the author. Depending on complexity of a task it is possible to use as normal non-breaking spaces, and to manage quantity of spaces by means of css-properties.

It is required to you

  • - HTML editor

Instruction

1. If you need to insert one normal space between words (it turns out at the key press of Space), it is not necessary to perform any special operations — any quantity of the going in a row normal spaces in HTML code will look on the web page as one.

2. For maintaining exact quantity of spaces between words replace each normal space with characters """ "(without quotes) is a code of a non-breaking space in html. For example: "Between  each  word  two  spaces". The non-breaking space is inserted between two words and in order that they were not separated at transfer into other line. For automatic arrangement of non-breaking spaces in the text it is convenient to use the known tool of Artemy Lebedev — "Printer" (http://www.artlebedev.ru/tools/typograf/).

3. One more way to insert the conceived quantity of spaces into html between words: conclude the necessary part of the text in tags and. Then words will be displayed by a monospaced font, but all normal spaces between words at display on the web page will be saved. Pay attention, the tag has features: in it use of some other tags is not allowed: and.

4. More difficult method of management of processing of spaces: use white-space css-property with pre or pre-wrap value (without line folding in an element and with line folding respectively). Specify this property in the description of style of the page or a single HTML imposition element. When using this method the font does not change on monowide, and the quantity of spaces between words is maintained. Example: How to insert a space into HTML code? Or: .free_spaces {white-space: pre-wrap; } … How to insert a space into HTML code?

Author: «MirrorInfo» Dream Team


Print