Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am new in HTML and all the coding thing so my teacher ask me a question he put this < p >,</ p > to make a paragraph and ask me that how that tag knows what to do and where he comes from whats its source at that time i gave him stupid answers like files saves on backhand but after that he gave me assignment on this so i need to know all about it to make a assignment and sorry for the bad English
THANKS

What I have tried:

I try to google it but i dont know what to write on google

Posted
Updated 29-Aug-17 9:35am
v4

The tag makes sure a new paragraph is created, because the HTML specification (constructed by the W3C) says so: HTML5 (w3.org)[^]. Specific part: 4.4.1 The p element — HTML5[^].

The tag doesn't actually "know what to do", because HTML is just a markup language and doesn't "know" anything by itself. However, your web browser does know what <p> means, because browsers follow the HTML spec that I linked. So your browser renders it as a new paragraph.
 
Share this answer
 
Comments
Muhammad Raza Khan 29-Aug-17 13:16pm    
yes that what i am trying to ask what is the source of all the tags and everything that how they executes
Thomas Daniels 29-Aug-17 13:18pm    
I don't know what you mean by "source" - the tags and their effects have been defined by the W3C, if that's what you mean.

Tags don't "execute", they merely define the markup of a web page: a browser parses the HTML and renders it in the browser window, the way the HTML spec defines.
Muhammad Raza Khan 29-Aug-17 13:23pm    
Thanks for your help but i need more understanding because of my assignment so how browser understand those tags when we run html code how they understand tags and data flow of html
Thomas Daniels 29-Aug-17 13:29pm    
The browser is able to parse the HTML code into a tree of elements, and the code of the browser also implements the 'meaning' of the tags so it knows how to render them.

The algorithms to parse HTML are too complicated to simply explain in a comment here. There are definitely articles about it on the internet, but they won't be useful if you don't have prior programming experience.

What do you mean by 'data flow'?
Dave Kreskowiak 29-Aug-17 13:33pm    
HTML is not "code" in the execution sense. It's markup to tell the browser how to render the page on screen.
Try HTML - Wikipedia[^], which will increase your knowledge, in general, about what you will be doing.
 
Share this answer
 
Quote:
how that tag knows what to do

The tag knows nothing and does nothing. The one knowing and doing is the browser, the html page is just text. The tags are seen by browser as directions to render the page.

This site is a tutorial site about wen apps, the site allow you to experiment.
W3Schools Online Web Tutorials[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900