forked from ashwin6cs/study-welfare-tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathf2.html
183 lines (155 loc) · 8.28 KB
/
f2.html
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<!DOCTYPE html>
<html>
<head>
<title>HTML Basic Tags</title>
<link rel="shortcut icon" sizes="200*200" type="image/x-icon" href="logo1.jpg"></head>
<body style="background-color: aliceblue;color:rgb(90, 46, 194)">
<h2>Heading Tags</h2>
<p>Any document starts with a heading. You can use different sizes for your headings. HTML also has six levels of headings, which use the elements <b><h1>, <h2>, <h3>, <h4>, <h5>,</b> and <b><h6></b>. While displaying any heading, browser adds one line before and one line after that heading.</p>
<h3>Example</h3>
<pre style="background-color:azure; style="background-color:azure; style="background-color:azure; class="prettyprint notranslate">
<!DOCTYPE html>
<html>
<head>
<title>Heading Example</title>
</head>
<body>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>
</body>
</html>
</pre>
</div>
<a target="_blank" href="f2-1.html" class="w3-btn w3-margin-bottom"><button style="background-color:rgb(115, 126, 226);">Try it Yourself</button> »</a>
</div>
<h2>Paragraph Tag</h2>
<p>The <b><p></b> tag offers a way to structure your text into different paragraphs. Each paragraph of text should go in between an opening <p> and a closing </p> tag as shown below in the example −</p>
<h3>Example</h3>
<pre style="background-color:azure; style="background-color:azure; style="background-color:azure; class="prettyprint notranslate">
<!DOCTYPE html>
<html>
<head>
<title>Paragraph Example</title>
</head>
<body>
<p>Here is a first paragraph of text.</p>
<p>Here is a second paragraph of text.</p>
<p>Here is a third paragraph of text.</p>
</body>
</html>
</pre>
</div>
<a target="_blank" href="f2-2.html" class="w3-btn w3-margin-bottom"><button style="background-color:rgb(115, 126, 226);">Try it Yourself</button> »</a>
</div>
<h2>Line Break Tag</h2>
<p>Whenever you use the <b><br /></b> element, anything following it starts from the next line. This tag is an example of an <b>empty</b> element, where you do not need opening and closing tags, as there is nothing to go in between them.</p>
<p>The <br /> tag has a space between the characters <b>br</b> and the forward slash. If you omit this space, older browsers will have trouble rendering the line break, while if you miss the forward slash character and just use <br> it is not valid in XHTML.</p>
<h3>Example</h3>
<pre style="background-color:azure; style="background-color:azure; style="background-color:azure; class="prettyprint notranslate">
<!DOCTYPE html>
<html>
<head>
<title>Line Break Example</title>
</head>
<body>
<p>Hello<br />
You delivered your assignment ontime.<br />
Thanks<br />
Mahnaz</p>
</body>
</html>
</pre>
</div>
<a target="_blank" href="f2-3.html" class="w3-btn w3-margin-bottom"><button style="background-color:rgb(115, 126, 226);">Try it Yourself</button> »</a>
</div>
<h2>Centering Content</h2>
<p>You can use <b><center></b> tag to put any content in the center of the page or any table cell.</p>
<h3>Example</h3>
<pre style="background-color:azure; style="background-color:azure; style="background-color:azure; class="prettyprint notranslate">
<!DOCTYPE html>
<html>
<head>
<title>Centring Content Example</title>
</head>
<body>
<p>This text is not in the center.</p>
<center>
<p>This text is in the center.</p>
</center>
</body>
</html>
</pre>
</div>
<a target="_blank" href="f2-4.html" class="w3-btn w3-margin-bottom"><button style="background-color:rgb(115, 126, 226);">Try it Yourself</button> »</a>
</div>
<h2>Horizontal Lines</h2>
<p>Horizontal lines are used to visually break-up sections of a document. The <b><hr></b> tag creates a line from the current position in the document to the right margin and breaks the line accordingly.</p>
<p>For example, you may want to give a line between two paragraphs as in the given example below −</p>
<h3>Example</h3>
<pre style="background-color:azure; style="background-color:azure; style="background-color:azure; class="prettyprint notranslate">
<!DOCTYPE html>
<html>
<head>
<title>Horizontal Line Example</title>
</head>
<body>
<p>This is paragraph one and should be on top</p>
<hr />
<p>This is paragraph two and should be at bottom</p>
</body>
</html>
</pre>
</div>
<a target="_blank" href="f2-5.html" class="w3-btn w3-margin-bottom"><button style="background-color:rgb(115, 126, 226);">Try it Yourself</button> »</a>
</div>
<p>Again <b><hr /></b> tag is an example of the <b>empty</b> element, where you do not need opening and closing tags, as there is nothing to go in between them.</p>
<p>The <b><hr /></b> element has a space between the characters <b>hr</b> and the forward slash. If you omit this space, older browsers will have trouble rendering the horizontal line, while if you miss the forward slash character and just use <b><hr></b> it is not valid in XHTML</p>
<h2>Preserve Formatting</h2>
<p>Sometimes, you want your text to follow the exact format of how it is written in the HTML document. In these cases, you can use the preformatted tag <b><pre></b>.</p>
<p>Any text between the opening <b><pre></b> tag and the closing <b></pre></b> tag will preserve the formatting of the source document.</p>
<h3>Example</h3>
<pre style="background-color:azure; style="background-color:azure; style="background-color:azure; class="prettyprint notranslate">
<!DOCTYPE html>
<html>
<head>
<title>Preserve Formatting Example</title>
</head>
<body>
<pre>
function testFunction( strText ){
alert (strText)
}
</pre>
</body>
</html>
</pre>
</div>
<a target="_blank" href="f2-6.html" class="w3-btn w3-margin-bottom"><button style="background-color:rgb(115, 126, 226);">Try it Yourself</button> »</a>
</div>
<h2>Nonbreaking Spaces</h2>
<p>Suppose you want to use the phrase "12 Angry Men." Here, you would not want a browser to split the "12, Angry" and "Men" across two lines −</p>
<pre style="background-color:azure; style="background-color:azure; class="result notranslate">
An example of this technique appears in the movie "12 Angry Men."
</pre>
<p>In cases, where you do not want the client browser to break text, you should use a nonbreaking space entity <b>&nbsp;</b> instead of a normal space. For example, when coding the "12 Angry Men" in a paragraph, you should use something similar to the following code −</p>
<h3>Example</h3>
<pre style="background-color:azure; style="background-color:azure; style="background-color:azure; class="prettyprint notranslate">
<!DOCTYPE html>
<html>
<head>
<title>Nonbreaking Spaces Example</title>
</head>
<body>
<p>An example of this technique appears in the movie "12&nbsp;Angry&nbsp;Men."</p>
</body>
</html>
</pre>
</div>
<a target="_blank" href="f2-7.html" class="w3-btn w3-margin-bottom"><button style="background-color:rgb(115, 126, 226);">Try it Yourself</button> »</a>
</div>
</body>
</html>