18 December 2016
Lecture 8: HTML Character Entity References
As HTML itself uses the > , < and & signs in its code, to put these symbols in your content you should use < , > and & respectively.
Also, it is safer to use " for quotations as some browsers or might use a limited encoding rather than the utf-8.
There are also many other character entity references in HTML. An useful one is the copyright symbol © .
Example is given below:
Another useful entity is the
Generally when we resize the browser window, the webpage text gets warped. But if you use between the words (with no space) those words will always remain together.
For example: If you write -
My is&npsp;John Doe
- then the text "My name is John Doe" will always stick together (i.e. the text won't break at midpoint and will always remain in the same line even if the browser is resized).
As you know, in an HTML code, if you put multiple spaces between words, the browser still counts only one space. Some people used multiple times to force the browser to display multiple spaces. But that is really a bad practice and &npsp; should not be used for that purpose. There are other ways to put multiple spaces between words, which we will learn later.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment