-
Notifications
You must be signed in to change notification settings - Fork 0
/
HTML-basics.html
269 lines (244 loc) · 7.37 KB
/
HTML-basics.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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>HTML BASICS: STRUCTURING YOUR FIRST WEB PAGE</title>
<style>
*,body{
margin:0;
padding:0;
box-sizing:border-box;
}
.header {
background-color: #4600FF;
padding: 20px;
font-family: monospace;
width: 100vh;
color: white;
}
.top-nav{
padding:10px;
display:flex;
gap:15px;
}
.top-nav a{
display:block;
}
h1,h2,p,code,button{
margin:10px;
}
code{
color:#5B05FF;
background:#E3E3E3;
}
button{
width:99%;
padding:10px;
background:#5500FF;
color:white;
border:none;
border-radius:100px;
font-family:monospace;
transition:0.6s;
}
button:hover{
background:white;
border:1px solid #5500FF;
color:#5500FF;
}
footer{
margin-top:30px;
padding:50px;
background:#75717F;
color:white;
text-align:center;
}
a{
text-decoration:none;
font-family:monospace;
}
.root{
padding:15px;
}
.img-contain{
display:flex;
justify-content:center;
align-items:center;
}
img{
width:60vw;
height:30vh;
}
@media only screen and (min-width:720px){
img{
width:45vw;
height:20vh;
}
}
</style>
</head>
<body>
<section class="root">
<div class="top-nav">
<a href="blogs.html">tutorials</a>
<a href="codeditor.html">code</a>
<a href="index.html">home</a>
</div>
<div class="img-contain">
<img src="html.png" alt="html.png">
</div>
<h1>HTML Basics: Structuring Your First Web Page</h1>
<p>Welcome to our HTML Basics tutorial! In this tutorial, we'll cover the fundamental HTML elements and structure to create a basic web page.</p>
<h2>Introduction to HTML</h2>
<p>HTML (Hypertext Markup Language) is the standard markup language used to create web pages. It's the backbone of a website, providing the structure and content that the web browser renders to the user.</p>
<h2>Basic HTML Structure</h2>
<p>Every HTML document starts with the following basic structure:</p>
<pre>
<code><!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<!-- page content here -->
</body>
</html>
</code>
</pre>
<p>Let's break it down:</p>
<br>
- <code><!DOCTYPE html>: Declares the document type as HTML5.</code>
<br>
- <code><html>: The root element of the HTML document.</code>
<br>
- <code><head>: Contains metadata about the document, such as the title, charset, and links to external stylesheets or scripts.</code>
<br>
- <code><title>: Sets the title of the page, displayed in the browser's title bar and search engine results</code>
- <code><body>: Contains the content of the HTML document.
</code>
<br>
<h1>Headings and Paragraphs</h1>
<p>Headings and paragraphs are basic HTML elements used to structure content.</p>
<code>
<br>
- Headings: <h1>, <h2>, <h3>, etc. represent headings of different levels.
<br>
- Paragraphs: <p> represents a paragraph of text.
<br>
</code>
<b>Example:</b>
<br>
<code>
<h1>Main Heading</h1>
<br>
<p>This is a paragraph of text.</p>
</code>
<h2>Links and Images</h2>
<br>
<p>Links and images are essential elements in HTML.</p>
<code>
<br>
- Links: <a> represents a hyperlink to another web page or email address.
<br>
- Images: <img> represents an image file.
<br>
</code>
<b>Example:</b>
<br>
<a href="#">Visit</a>
<img src="image.jpg" alt="An image on the page">
<br>
<h2>Lists and Tables</h2>
<br>
<p>Lists and tables help organize content.</p>
<code>
<br>
- Unordered Lists: <ul> represents an unordered list, with <li> representing each list item.
<br>
- Ordered Lists: <ol> represents an ordered list, with <li> representing each list item.
<br>
- Tables: <table> represents a table, with <tr> representing each table row and <td> representing each table data cell.
</code>
<br>
<b>Example:</b>
<code>
<ul>
<br>
<li>Item 1</li>
<br>
<li>Item 2</li>
<br>
</ul>
<br>
<table>
<br>
<tr>
<br>
<td>Cell 1</td>
<br>
<td>Cell 2</td>
<br>
</tr>
<br>
</table>
<br>
</code>
<h2>Forms and Inputs</h2>
<br>
<p>Forms and inputs allow users to interact with the web page.</p>
<br>
<p>
- <code>Forms: <form> represents a form, with <input>, <textarea>, and <select> representing different input fields.</code>
</p>
<br>
<b>Example:</b>
<br>
<code>
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name">
</form>
</code>
<br>
<h2>Conclusion and Next Steps</h2>
<p>
Congratulations! You've learned the basic HTML elements and structure. Practice building your own web page using this tutorial as a reference. In the next tutorial, we'll explore CSS basics to style your web page.
</p>
<button><a style="color:white" href="codeditor.html">«see it in action»</a></button>
<h2>Frequently Asked Questions</h2>
<dl>
<dt><b>What is HTML?</b></dt>
<dd>HTML stands for "HyperText Markup Language". It's a standard markup language used to create web pages.</dd>
<dt><b>What is the basic structure of an HTML document?</b></dt>
<dd>The basic structure includes the <!DOCTYPE html>, <html>, <head>, and <body> elements.</dd>
<dt><b>What is the difference between <div> and <span>?</b></dt>
<dd><div> is a block-level element, while <span> is an inline element.</dd>
<dt><b>How do I add an image to a web page?</b></dt>
<dd>Use the <img> element with the src attribute to specify the image URL.</dd>
<dt><b>What is the purpose of the <head> section?</b></dt>
<dd>The <head> section contains metadata about the document, such as the title, charset, and links to external stylesheets or scripts.</dd>
<dt><b>How do I create a hyperlink?</b></dt>
<dd>Use the <a> element with the href attribute to specify the link URL.</dd>
<dt><b>What is the difference between <ul>, <ol>, and <dl>?</b></dt>
<dd><ul> is an unordered list, <ol> is an ordered list, and <dl> is a definition list.</dd>
<dt><b>How do I add a comment to an HTML document?</b></dt>
<dd>Use <!-- to start and --> to end the comment.</dd>
<dt><b>What is the purpose of the <title> element?</b></dt>
<dd>The <title> element sets the title of the page, which appears in the browser's title bar and search engine results.</dd>
<dt><b>How do I create a table in HTML?</b></dt>
<dd>Use the <table> element, along with <tr> for table rows, <td> for table data cells, and <th> for table header cells.</dd>
<dt><b>What is the difference between <strong> and <b>?</b></dt>
<dd><strong> indicates strong importance or emphasis, while <b> simply bolds the text.</dd>
</dl>
</section>
<footer>
<p>©somnath pan</p>
<p>all rights reserved</p>
<a href="tutorials.html">tutorials</a>
<a href="codeditor.html">code</a>
<a href="index.html">home</a>
<a href="DEBUGGING_STATION.html">debugging station</a>
</footer>
</body>
</html>