ENTITIES IN HTML ( # tutorial 15 )

in blurtutorials •  4 years ago 

Let us try to understand in the very basic level about entities.
Well , when you code in html then you can do many things like creating a paragraph , divs , links etc.

But have you noticed few things :

  1. try giving three spaces in your webpage between two words
  2. try writing the copyright sign
  3. try writing greater than or less than sign in your html para's.

well there can be a long list but i have mentioned three out of them and when you will try writing those you will simply fail to do so because :

  1. when it comes to spaces the webpage take number of spaces prodeuced using spacebar together as one space.

  2. You will simply not find the copyright sign on your keyboard and even if you search the same on internet simply copy pasting won't work.

  3. when you will try to write '>' or '<' then your webpage consider these as opening and closing tags so again it won't appear on your webpage.

So what is the solution to this...? Well the solution is Html Entities.

HTML-Entities.jpg

Source

html entities are written as :

'&' followed by the entity code or entity code number
examples in our case :

&nbsp; ----> used for giving spaces between two words.
&copy; ----> used to generate copyright logo.
&lt;  and &gt; ----> for less than and greater than sign.



Let us create something using the entities in html.
let us write :

  1. "@megadrive is co-founder of BLURT ©"
  2. "@jacobgadikian own the xyz.com website ©" and we will write this by creating more than one spaces.

STEPS


Step 1 : create a proper html structure for your file.

Step 2 : Write the follwing code inside the body tag.

Screenshot from 2020-11-27 23-34-55.png

Step 3 : Run the file with any browser to see the result.

Screenshot from 2020-11-27 23-34-34.png

Full Code :

<!DOCTYPE html>

<html>
<head>
   <meta charset="utf-8">
   <title>my first web page is here</title>
</head>

<body>
 <h2>@megadrive is co-founder of BLURT &copy;</h2>
    <h2> @jacobgadikian &nbsp;&nbsp;&nbsp;  own &nbsp;&nbsp;
     the &nbsp;&nbsp;&nbsp;&nbsp; xyz.com website &nbsp;&nbsp;&nbsp;&nbsp; &copy;</h2>

</body>

</html>



That's it for this tutorial , i Hope it was helpful to all.

Thank You.

Links for previous tutorials

  1. HTML BASICS AND CREATING PARAGRAPHS
  2. Headings in Html
  3. ANCHOR TAGS IN HTML
  4. Image tag in Html
  5. CREATE YOUR BASIC WEBSITE
  6. Inline Elements in Html
  7. BLOCK ELEMENTS IN HTML
  8. CONCEPT OF IFRAMES IN HTML , FULL TUTORIAL
  9. UNORDERED LIST IN HTML
  10. UNORDERED LIST And Creating Sub list for same
  11. ORDERED LIST IN HTML
  12. Description List in Html
  13. Tables in Html
  14. USING CONCEPT OF TABLES IN HTML
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE BLURT!
Sort Order:  

Weldone, this is amazing, you can do a lot on blurt with this.

I would like you to follow @blurttalenthunt to participate in any activity of your desire. @blurttalenthunt opens opportunity for everyone to showcase their talents on the blurt blockchain. So it doesn't matter what your talent is, you are qualified to engage!

Thanks, i am @adesojisouljay, the unique being.