Introduction To HTML - GHCC HackToLearn
Introduction To HTML - GHCC HackToLearn
Campus Club
PSG COLLEGE OF TECHNOLOGY
HTML
HTML - HyperText Markup Language
standard markup language
used to create and design documents on the
World Wide Web.
CODE IN ACTION
<p>Paragraph 1: This is the first paragraph of text.</p>
<p>Paragraph 2: This is another paragraph with more
content.</p>
NOTE:
<p> This sentence has extra spaces, but HTML will
display it with only single space. </p>
LINKS
<a href="URL">Link Text</a>
<a> tag (anchor tag)
href : This specifies the destination URL where the link points to.
Link Text: This is the clickable text that the user sees.
CODE IN ACTION
<a href="https://www.wikipedia.org">Visit Wikipedia</a>
CODE IN ACTION
<img src="https://example.com/image.jpg" alt="An example
image" width="300" height="200">
A QUICK REFRESH!
<!DOCTYPE html>
<html>
<head>
<title>My Simple HTML Page</title>
</head>
<body>
<h1>Welcome to My Simple HTML Page</h1>
<h2>About This Page</h2>
<p>This page demonstrates the basic structure of an HTML.</p>
<h3>Learn More About HTML</h3>
<p>To explore more about HTML, visit <a
href="https://www.w3schools.com/html/"
target="_blank">W3Schools HTML Tutorial</a>.</p>
h3>Image Example</h3>
<img src="https://source.unsplash.com/600x400/?nature"
alt="Beautiful nature">
</body>
</html>
FORMATTING TEXT
<strong> tag indicates that the text is of strong importance
<em> tag is used to emphasize text, rendering it in italic by default
<b> tag simply makes the text bold without implying any importance.
CODE IN ACTION
<p> Don't forget to visit our booth for a <b>free sample</b> at the
trade show! </p>
BREAK
<br> tag does not require a closing tag
<br> tag is to create a new line in the text, which can be useful for
formatting content without adding extra space
CODE IN ACTION
<!DOCTYPE html>
<html>
<head>
<title>Using BR Tag</title>
</head>
<body>
<h2>Address Example</h2>
<p>
123 Main Street<br>
Springfield, IL 62701<br>
United States
</p>
</body>
</html>
DIVISION
<div> tag is commonly employed to create sections in a webpage.
class attribute is used within a <div> tag (or any other HTML element) to
define a specific style or behavior for that element.
CODE IN ACTION
<div class="header">
<h1>My Website Title</h1>
</div>
<div class="content">
<p>Welcome to my website. This is where I share my thoughts.</p>
</div>
<div class="footer">
<p> 2024 My Website</p>
</div>
LISTS
ordered lists (<ol>)
<ol>
<li>Item 1</li> <li>=list item
<li>Item 2</li>
</ol>
unordered lists (<ul>)
<ul>
<li>Item A</li>
<li>Item B</li>
</ul>
description lists (<dl>) <dt>=definition term
<dl> <dd>=definition description
<dt>Term 1</dt>
<dd>Description of Term 1.</dd> <dd>
</dl>
CODE IN ACTION
<ul>
<li>Apples</li>
<li>Bananas</li>
<li>Cherries</li>
</ul>
<dl>
<dt>HTML</dt>
<dd>A markup language used for creating web pages.</dd>
<dt>CSS</dt>
<dd>A stylesheet language used for describing the
presentation of a document written in HTML.</dd>
</dl>
TABLE
<table>: This tag defines the entire table.
<tr>: This tag defines a table row.
<th>: This tag defines a table header cell, typically used for column
headings.
<td>: This tag defines a standard table data cell.
CODE IN ACTION
<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>John Doe</td>
<td>20</td>
</tr>
</table>
FORMS
<form action="/submit" method="POST">
<!-- Form elements go here -->
</form>
action: Specifies the URL to which the form data will be sent when the
form is submitted.
method: Specifies the HTTP method to use when sending form data. Common
methods include GET and POST.
<h2>Registration Form</h2>
<form action="/submit" method="POST">
<label for="username">Username:</label>
<input type="text" id="username" name="username"
required><br><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required><br><br>
<label for="password">Password:</label>
<input type="password" id="password" name="password"
required><br><br>
<label for="gender">Gender:</label>
<select id="gender" name="gender">
<option value="male">Male</option>
<option value="female">Female</option>
<option value="other">Other</option>
</select><br><br>
</body>
</html>
PRACTICE!
Personal Profile Page
Objective: Create a simple personal profile webpage using basic HTML tags.
Instructions: