Thursday, August 21, 2014

Examining the structure of an HTML document

In a complete HTML Document have several different parts. Let’s take a look of some of them are:-










Here, in first line we have DOCTYPE declaration. The purpose of this, to tell the browser what version of HTML is to be expecting to be the rest of the document. If you see the DOCTYPE declaration before you notice. This one is very-very simple. This is the way the DOCTYPE declaration is supposed to look in HTML 5 complete document. HTML 5 or other version of HTML have much more complicated DOCTYPE include with details with DTD and things like that because HTML is now divorced from SGML. We don’t need DTD is actually no longer a valid thing to do. So, the purpose of this DOCTYPE declaration is become, just to tell the browser don’t use Quirk mode use standard mode. This a standard complain document. So, the DOCTYPE elements look like.
It should be the very first things in your document before any comment before any white space. If it’s not the very first thing and working on. Some browser it will not working on other browser. In particularly many version of Internet Explorer will fall back in Quirks mode. If that DOCTYPE is not the very first thing in the file. So, you just put it in at very top before your comments and anything else you use. Put it in there, and it do its job cross the board.
Comment in line two a comment is introduce by a left angle bracket and an exclamation point followed by two dash and a space and is all very important and in the end of the comment have four characters space followed by two dashes and right angle bracket.
Ex: -
Note: - one things keep in mind do not use two dashes right next to each other in your comments. Rest of this document is a tree of elements called a DOM tree document object model tree. At the root of the tree. The HTML element




Opening tag
Notice here we have an opening tag and tag in html. And they have this left angle bracket. So, the name of tag and then any attribute and then right angle bracket and then end tag. Left angle bracket and forward slash. Tag name and then closing angle bracket and end tag. Have no any attributes








That make head element a container anything from the opening tag end tag including everything in between all part of the “html” element. So, the content of the element from the head element which start there and ends there and ends there and the body element starts there ends there and the content of the head include all of these element “meta”, “title”, “links” and the contains of the body element includes these two elements h1 and “p” and in the head element and the body element are both children of the HTML. And so, the branches of the tree you could see html element to be the root of the tree and head and body to be the two sibling children or branches of same level and so the parent of the head element is html. And its children are “meta”, “title”, and link body consider as sibling. So, head element where you put things are head matter inside the document these “meta” tag which give the information about the document there is a title tag which describe the title that go in the title bar of the browser and the link tag which links up other related document in this case a CSS document stylesheet. If this CSS document isn’t there then it will not load the style layout in that CSS document. But html work just fine. It is just going to be ignored. And, then inside the body we have an h1 element which define a header which display bold and element describe a paragraph
consider as sibling. So, head element where you put things are head matter inside the document these “meta” tag which give the information about the document there is a title tag which describe the title that go in the title bar of the browser and the link tag which links up other related document in this case a CSS document stylesheet. If this CSS document isn’t there then it will not load the style layout in that CSS document. But html work just fine. It is just going to be ignored. And, then inside the body we have an
element which define a header which display bold and element describe a paragraph.  

consider as sibling. So, head element where you put things are head matter inside the document these “meta” tag which give the information about the document there is a title tag which describe the title that go in the title bar of the browser and the link tag which links up other related document in this case a CSS document stylesheet. If this CSS document isn’t there then it will not load the style layout in that CSS document. But html work just fine. It is just going to be ignored. And, then inside the body we have an

element which define a header which display bold and element describe a paragraph.

No comments:

Post a Comment