HTML Tutorial | HTML special characters

Home Forums Tech HTML HTML Tutorial | HTML special characters

Tagged: 

This topic contains 0 replies, has 1 voice, and was last updated by  MasterMind 5 months, 1 week ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #421

    MasterMind
    Keymaster

    Symbols that can not be displayed in HTML documents in the usual way are called special characters.

    A special character can be displayed only using the corresponding mnemonic or special code.

    Syntax:

    & Character Mnemonic;
    <! - or -> 
    & # character-code;

    Using special characters

    The most commonly used special character is an inseparable space (its mnemonics & nbsp; ).

    This character is used to control the line break (no automatic line break is possible after this character) and to insert spaces that go to the text in succession (by default, if you insert 5 consecutive spaces in the text, the browser will cut 4 and display only one):

    Example

    <p> The text below contains six spaces: </ p> <p> The first word is & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; second word </ p>
    

    Also in the HTML code special symbols < (mnemonics < ) and > (mnemonics > ) are often used . These characters can not be used directly in the code, because the browser confuses them with the beginning of the tags.

    Example

    <p> The text below contains HTML tags: </ p> 
    & lt; head & gt ;, & lt; p & gt ;, & lt; html & gt;

    Mnemonics and codes of frequently used special symbols

    Symbol Description Mnemonics Code
    Space & nbsp; & # 160;
    < Less than & lt; & # 60;
    > More than & gt; & # 62;
    © Copyright mark & copy; & # 169;
    ® Registered Trademark & gt; & # 174;
    & Ampersand sign & amp; & # 38;

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.