This repository has been archived by the owner on Aug 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2207-Intro.txt
102 lines (57 loc) · 3.54 KB
/
2207-Intro.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Html - Hyper Text Markup Language
----------------------------------------------------------------------
HTML is a standard or specification and it is derived from SGML - Standard Generialized Markup Language. Extensible Markup Language (XML) standard is also derived from SGML.
HTML is used to present the data (for presentation purpose)
XML is used to describe the data (for data communication protocol)
HTML markup language has tags/elements which are implemented by different browser vendors (Chrome, Mozilla, IE etc). The W3C - World Wide Web Consortium develop the standard (specification) and its implementation is performed by browser vendors.
[Note: Visit w3.org for more details]
<!DOCTYPE html> --- processing instruction
------------------------------------------------------------------
When we load "HTML" document, the web-browser will starts with one or the two modes : Quirk or Standard Mode.
If <!DOCTYPE> is not specified then your browser will be started using "Quirk Or Dirty" mode and in this mode view of web-document might
surprise you with different behaviors.
If <!DOCTYPE> is set then browser will launched with "Standard" mode which validate the HTML markup and ensure the only correct tags can be parsed/processed.
HTML elements and basic guideline to write them
--------------------------------------------------------------
1. HTML elements are not case-sensitive so you can write them in capital or small letters. However, we'll write elements in lower- case.
2. Attribute value can be surrounded using single or double quotes but it is not mandatory.
<input type=text /> <---valid
<input type="text" /> <-- valid
<input type='text' /> <-- valid
It is mandatory when value of attribute is space or comma delimited.
<input type=submit value=Press this button /> <-- not valid
<input type=submit value="Press this button" />
Always use double/single quotes to set attribute value.
3. Opened tags can be written as follows:
<input type="text"> <--- valid
<input type="text" /> <-- valid (xhtml standard)
<br> or <br/> Line break
<hr> or <hr/> Horizontal rule
4. Tags must be nested. Do not interset the elements.
<div>
<p>
First Para
</p>
</div>
but following is invalid :
<div>
<p>
First Para
</div>
</p>
5. Whitespaces are ignored. Two or more whitespace are converted to single space.
<div>This is sample text</div>
will output :
This is sample text
6. To avoid confusion to parse some "special" characters -- HTML entities are introduced.
For example,
To print less then ( < ) in html document :
< <--- html entity
is used.
<test>This is test text</test>
output : <test>This is test text</test>
7. Always use CSS "selectors" to format the HTML elements. (Always use Cascade StyleSheet)
What is an application of web-browser?
--------------------------------------
The web-browser reads html document, parse the content & elements. Remove invalid elements and create HTML objects (or Document Object Model) of all valid elements and render them via "graphics engine".
[Note: google chrome uses "web-kit" graphics engine and diferent browser uses different graphics engine.]