Entities

HTML Entities

Reserved characters in HTML must be replaced with character entities.

HTML Entities

Some characters are reserved in HTML.

If you use the less than (<) or greater than (>) signs in your text, the browser might mix them with tags.

Character entities are used to display reserved characters in HTML.

A character entity looks like this:

Advantage of using an entity name: An entity name is easy to remember.
Disadvantage of using an entity name: Browsers may not support all entity names, but the support for entity numbers is good.

Non-breaking Space

A commonly used entity in HTML is the non-breaking space:  

A non-breaking space is a space that will not break into a new line.

Two words separated by a non-breaking space will stick together (not break into a new line). This is handy when breaking the words might be disruptive.

Another common use of the non-breaking space is to prevent browsers from truncating spaces in HTML pages.

If you write 10 spaces in your text, the browser will remove 9 of them. To add real spaces to your text, you can use the   character entity.

Tip: The non-breaking hyphen (‑) is used to define a hyphen character (‑) that does not break into a new line.

Some Useful HTML Character Entities

Result Description Entity Name Entity Number Try it
non-breaking space     Try it »
less than < < Try it »
> greater than > > Try it »
& ampersand & & Try it »
« double quotation mark " " Try it »
single quotation mark (apostrophe) ' ' Try it »
¢ cent ¢ ¢ Try it »
£ pound £ £ Try it »
¥ yen ¥ ¥ Try it »
euro Try it »
© copyright © © Try it »
® registered trademark ® ® Try it »

Note: Entity names are case sensitive.

Combining Diacritical Marks

A diacritical mark is a «glyph» added to a letter.

Some diacritical marks, like grave ( ̀) and acute ( ́) are called accents.

Diacritical marks can appear both above and below a letter, inside a letter, and between two letters.

Diacritical marks can be used in combination with alphanumeric characters to produce a character that is not present in the character set (encoding) used in the page.

Mark Character Construct Result Try it
̀ a Try it »
́ a Try it »
̂ a Try it »
̃ a Try it »
̀ O Try it »
́ O Try it »
̂ O Try it »
̃ O Try it »

You will see more HTML symbols in the next chapter of this tutorial.

Источник

Руководство HTML Entity

Следуйте за нами на нашей фан-странице, чтобы получать уведомления каждый раз, когда появляются новые статьи. Facebook

1- HTML Entity

Есть некоторые специальные символы, если они появляются в документе HTML, то могут вызвать недопонимание в синтаксическом анализаторе исходного кода​​​​​​​ HTML (HTML source parser), например символ «меньше» ( < ), при встрече с данным символом анализатор HTML может ошибочно принимает символ за тег. Чтобы избежать данное недопонимание, HTML использует объект (entity) < чтобы заменить символ ( < ).

Ниже являются некоторые распространенные символы, которые нужно заменить объектами (entity), полный список вы можете просмотреть в конце данной статьи.

Символ Описание Объект
Неразрывный пробел (Non-breaking Space)  
Меьше <
> Больше >
& Амперсант (ampersand) &
« Двойные кавычки (Double quotation mark) "
Одинарная кавычка (Single quotation mark) (апостроф) '

Посмотрите на документ HTML с появлением объектов и результат, который вы видите на браузере.

     

Entities example:

HTML defines six levels of headings.
The heading elements are:

<h1>, <h2>, <h3>, <h4>, <h5>, <h6>

Дополнительно к объектам, представляющим ошибочные символы, упомянутые выше, существует список многих объектов, представляющих другие специальные символы ( £ § ¢ ¥ © . )

Character Description Entity Name
¢ cent ¢
£ pound £
¥ yen ¥
§ section §
© copyright ©
® registered trademark ®

2- Entity Name vs Entity Number

Вы можете ссылаться на объект двумя способами. Одним из них является использование «Название объекта» или использование «Код объекта». Например, чтобы ссылаться на символ меньше ( < ), вы можете использовать название объекта ( < ) или использовать код объекта ( < ).

Преимущество использования названия объекта (entity name) заключается в том, что его легко запомнить. Однако недостатком является то, что некоторые браузеры могут не полностью поддерживать все названия объектов, тогда как они полностью поддерживают коды объектов.

Display Description Entity Name Entity Number
Non-breaking space    
Less than < <
> Greater than > >
& Ampersand & &
« Double quotation mark " "
Single quotation mark (apostrophe) ' '

3- Non-breaking Space ( )

Объект   используется для замены «неразрывного пробела» (Non-breaking space). Чтобы легче понять, можете посмотреть изображение примера ниже:

  

This is a non breaking Sentence   !!

This sentence will be line breaks.

4- Список объектов

Display Description Entity Name Number Code
non-breaking space    
¡ inverted exclamation mark ¡ ¡
¤ currency ¤ ¤
¢ cent ¢ ¢
£ pound £ £
¥ yen ¥ ¥
¦ broken vertical bar ¦ ¦
§ section § §
¨ spacing diaeresis ¨ ¨
© copyright © ©
ª feminine ordinal indicator ª ª
« angle quotation mark (left) « «
¬ negation ¬ ¬
­ soft hyphen ­ ­
® registered trademark ® ®
trademark
¯ spacing macron ¯ ¯
° degree ° °
± plus-or-minus ± ±
² superscript 2 ² ²
³ superscript 3 ³ ³
´ spacing acute ´ ´
µ micro µ µ
paragraph
· middle dot · ·
¸ spacing cedilla ¸ ¸
¹ superscript 1 ¹ ¹
º masculine ordinal indicator º º
» angle quotation mark (right) » »
¼ fraction 1/4 ¼ ¼
½ fraction 1/2 ½ ½
¾ fraction 3/4 ¾ ¾
¿ inverted question mark ¿ ¿
× multiplication × ×
÷ division ÷ ÷
Display Description Entity Name Number Code
À capital a, grave accent À À
Á capital a, acute accent Á Á
 capital a, circumflex accent  Â
à capital a, tilde à Ã
Ä capital a, umlaut mark Ä Ä
Å capital a, ring Å Å
Æ capital ae Æ Æ
Ç capital c, cedilla Ç Ç
È capital e, grave accent È È
É capital e, acute accent É É
Ê capital e, circumflex accent Ê Ê
Ë capital e, umlaut mark Ë Ë
Ì capital i, grave accent Ì Ì
Í capital i, acute accent Í Í
Î capital i, circumflex accent Î Î
Ï capital i, umlaut mark Ï Ï
Ð capital eth, Icelandic Ð Ð
Ñ capital n, tilde Ñ Ñ
Ò capital o, grave accent Ò Ò
Ó capital o, acute accent Ó Ó
Ô capital o, circumflex accent Ô Ô
Õ capital o, tilde Õ Õ
Ö capital o, umlaut mark Ö Ö
Ø capital o, slash Ø Ø
Ù capital u, grave accent Ù Ù
Ú capital u, acute accent Ú Ú
Û capital u, circumflex accent Û Û
Ü capital u, umlaut mark Ü Ü
Ý capital y, acute accent Ý Ý
Þ capital THORN, Icelandic Þ Þ
ß small sharp s, German ß ß
à small a, grave accent à à
á small a, acute accent á á
â small a, circumflex accent â â
ã small a, tilde ã ã
ä small a, umlaut mark ä ä
å small a, ring å å
æ small ae æ æ
ç small c, cedilla ç ç
è small e, grave accent è è
é small e, acute accent é é
ê small e, circumflex accent ê ê
ë small e, umlaut mark ë ë
ì small i, grave accent ì ì
í small i, acute accent í í
î small i, circumflex accent î î
ï small i, umlaut mark ï ï
ð small eth, Icelandic ð ð
ñ small n, tilde ñ ñ
ò small o, grave accent ò ò
ó small o, acute accent ó ó
ô small o, circumflex accent ô ô
õ small o, tilde õ õ
ö small o, umlaut mark ö ö
ø small o, slash ø ø
ù small u, grave accent ù ù
ú small u, acute accent ú ú
û small u, circumflex accent û û
ü small u, umlaut mark ü ü
ý small y, acute accent ý ý
þ small thorn, Icelandic þ þ
ÿ small y, umlaut mark ÿ ÿ
Display Description Entity Name Number Code
Œ capital ligature OE Œ Œ
œ small ligature oe œ œ
Š capital S with caron Š Š
š small S with caron š š
Ÿ capital Y with diaeres Ÿ Ÿ
ˆ modifier letter circumflex accent ˆ ˆ
˜ small tilde ˜ ˜
en space
em space
thin space
zero width non-joiner
zero width joiner
left-to-right mark
right-to-left mark
en dash
em dash
left single quotation mark
right single quotation mark
single low-9 quotation mark
left double quotation mark
right double quotation mark
double low-9 quotation mark
dagger
double dagger
horizontal ellipsis
per mille
single left-pointing angle quotation
single right-pointing angle quotation
euro

View more Tutorials:

Это онлайн курс вне вебсайта o7planning, который мы представляем, он включает бесплатные курсы или курсы со скидкой.

  • Projects in HTML5
  • * * Write quicker HTML5 and CSS 3; productivity hacks with emmet
  • HTML5 MasterClass Using Video & Audio in HTML5
  • HTML5, CSS3 & JavaScript Workshop: Build 7 Creative Projects
  • HTML 5 and CSS 3 — tricks and workarounds
  • HTML5 Game Development
  • Simple HTML5 Game Development
  • Ultimate HTML and CSS course for Absolute Beginners 2015
  • Learn How To Create Mobile Apps With HTML5
  • * * Основы HTML Базовый курс от Web Atom
  • HTML5 and javascript in Motion For Beginner Level course
  • HTML5 Mobile Game Development for Beginners with LimeJS
  • Web Design for Beginners: Real World Coding in HTML & CSS
  • A Web Development Crash Course in HTML5 and CSS3
  • * * Master the Basics of HTML5 & CSS3: Beginner Web Development
  • The Web Development Course: HTML5, CSS3, JavaScript
  • Learn To Build Beautiful HTML5 And CSS3 Websites In 1 Month
  • Core HTML How to get online quickly HTML to HTML5
  • HTML5 Mobile Game Development with Phaser
  • Building HTML5 Forms — Everything You Need To Know!
  • * * Beginner Photoshop to HTML5 and CSS3
  • HTML5 24-hr Trainer
  • Learn Construct 2: Creating a Puzzle Platformer in HTML5!
  • Beginner’s Guide to HTML and HTML5
  • Изучите HTML и CSS за несколько часов

Источник

Читайте также:  Get windows size html
Оцените статью