HTML Cac
HTML Cac
CAC HTML
3rd FLOOR, PRIYADARSHINI MARKET Satya Sir
CRPF SQUARE, BBSR, 751012
+91 9437089830
Module 1: INTRODUCTION
What is website?
A website is a collection of one or more web pages that may contain text, images, media, and other
digital content. These pages are hosted on a web server and can be accessed via the internet using a
browser.
Web development is the process of creating, building, and maintaining websites. It involves both the
design and functionality of websites, and can range from creating simple static pages to complex
web applications.
Database:
The system used to store and manage data. Common database systems include: SQL, MYSQL,
POSTGRESQL, MONGODB
CAC HTML
3rd FLOOR, PRIYADARSHINI MARKET Satya Sir
CRPF SQUARE, BBSR, 751012
+91 9437089830
Directory Setup
projectname/
|
|----- assets/ # Folder to store all static files like images, CSS, etc.
| | CSS/ # CSS files (optional)
| | images/ # Image files (optional)
|---- index.html # Main HTML file for the project
Opening VSCODE
We have various steps to open vscode in project directory
a) By opening vs code:
Open vs code
Goto fie
Click on open folder (ctrl + k ctrl + o)
Choose your file
b) By opening vs code from context menu
Open the project directory.
Right click in the blank space
Choose vs code (if window 11, goto show more options, click open with vscode)
c) By command prompt
Open cmd in the project directory
Type “ code .”
CAC HTML
3rd FLOOR, PRIYADARSHINI MARKET Satya Sir
CRPF SQUARE, BBSR, 751012
+91 9437089830
Module 2: Introduction to HTML
What is HTML?
HTML (Hypertext Markup Language) is the basic language used to create web pages and applications.
It uses tags to organize content like headings, paragraphs, links, images, lists, and forms. HTML helps
browsers display the content correctly. It works with CSS for styling and JavaScript for interactivity,
making it essential for building websites and enabling navigation through links.
<!DOCTYPE html>: Declares the document type and version of HTML (HTML5 here).
<html>: The root element that contains the entire HTML document.
<head>: Contains meta-information about the document, like the character encoding (<meta
charset="UTF-8">), viewport settings, and links to stylesheets.
CAC HTML
3rd FLOOR, PRIYADARSHINI MARKET Satya Sir
CRPF SQUARE, BBSR, 751012
+91 9437089830
<title>: Specifies the title of the webpage, shown in the browser tab.
<body>: Contains the content of the webpage, including headings, paragraphs, links, images,
etc.
<header>: Represents introductory content or navigation.
<nav>: Contains navigation links (e.g., menus).
<section>: Represents a section of content, often with a heading.
<footer>: Contains footer information such as copyright or contact details
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
</body>
</html>
CAC HTML
3rd FLOOR, PRIYADARSHINI MARKET Satya Sir
CRPF SQUARE, BBSR, 751012
+91 9437089830
Module 3: HTML BASICS
Introduction to tags element and attributes
Tags:
Tags are the building blocks of HTML.
They tell the browser how to display the content.
Tags are usually written in angle brackets.
Ex: <p>This is a paragraph.</p>
Attributes
Attributes provide extra information about an element.
They are written inside the opening tag.
They usually come in name="value" pairs.
Ex: <imgsrc="image.jpg" alt="A beautiful image"> // src and alt are attributes of the <img>
tag.
Elements
An element includes the opening tag, the content, and the closing tag.
The whole line is an HTML element.
Elements can also be empty (no content inside)
Ex: <h1>Welcome to My Website</h1> or, <br>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML CLASS</title>
</head>
<body>
<h1>Hello World</h1>
<h2>Hello World</h2>
<h3>Hello World</h3>
<h4>Hello World</h4>
<h5>Hello World</h5>
<h6>Hello World</h6>
</body>
</html>
CAC HTML
3rd FLOOR, PRIYADARSHINI MARKET Satya Sir
CRPF SQUARE, BBSR, 751012
+91 9437089830
HTML Paragraph Tags:
The HTML paragraph tag is used to define blocks of text as paragraphs. It helps structure content
into readable sections and adds spacing between chunks of text. Paragraphs make content easier to
read and improve overall layout and flow on a webpage.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML CLASS</title>
</head>
<body>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Fuga laboriosam autem quod
cum maxime corrupti voluptates a! Placeat tempora consequuntur ex sunt nulla aut ratione
hic quos ad dicta numquam beatae, doloribus exercitationem dolorem.</p>
</body>
</html>
<!DOCTYPE html>
CAC HTML
3rd FLOOR, PRIYADARSHINI MARKET Satya Sir
CRPF SQUARE, BBSR, 751012
+91 9437089830
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<button>Click Me</button>
<button type="submit">Click Me</button>
<button type="reset">Click Me</button>
<button disabled>Click Me</button>
</body>
</html>
CAC HTML
3rd FLOOR, PRIYADARSHINI MARKET Satya Sir
CRPF SQUARE, BBSR, 751012
+91 9437089830
Module 4: HTML BASIC FORMATING
Introduction
HTML (Hypertext Markup Language) uses formatting tags to change the appearance of text on a
webpage. These tags help enhance readability, structure, and emphasis for the user. Most
formatting tags either style the text (like bold or italic) or add structure (like line breaks or horizontal
lines).
Tags Description Example
<b> Bold text <b>Bold Text</b>
<strong> Important text (semantically bold) <strong>Strong Text</strong>
<i> Italic text <i>Italic Text</i>
<em> Emphasized text (semantically italic) <em>Emphasized Text</em>
<u> Underlined text <u>Underlined Text</u>
<ins> Inserted (underlined) text <ins>Inserted Text</ins>
<mark> Marked/highlighted text <mark>Highlighted</mark>
<small> Smaller text <small>Small Text</small>
<del> Deleted (strikethrough) text <del>Deleted Text</del>
<sub> Subscript text H<sub>2</sub>O
<sup> Superscript text x<sup>2</sup>
<br> Line break Line 1<br>Line 2
<hr> Horizontal rule Text<hr>More Text
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>HTML Formatting Example with "Satya"</title>
</head>
<body>
<p>this is <b>Satya</b>.</p>
<p>this is <strong>Satya</strong>.</p>
<p>this is <i>Satya</i>.</p>
<p>this is <em>Satya</em>.</p>
<p>this is <u>Satya</u>.</p>
<p>this is <ins>Satya</ins>.</p>
<p>this is <del>Satya</del>.</p>
<p>this is <mark>Satya</mark>.</p>
<p>this is <sub>Satya</sub>.</p>
<p>this is <sup>Satya</sup>.</p>
<p>this is <br>Satya.</p>
<hr>
<p>Nested example: <b><i><u>Satya</u></i></b> is bold, italic, and
underlined.</p>
<p>Multiple tags: <mark><strong><em>Satya</em></strong></mark> is highlighted,
strong, and emphasized.</p>
</body>
</html>
CAC HTML
3rd FLOOR, PRIYADARSHINI MARKET Satya Sir
CRPF SQUARE, BBSR, 751012
+91 9437089830
CAC HTML
3rd FLOOR, PRIYADARSHINI MARKET Satya Sir
CRPF SQUARE, BBSR, 751012
+91 9437089830
Module 5: HTML ANCHOR (LINK TAG)
Introduction
The HTML <a> (anchor) tag is used to create hyperlinks, enabling users to navigate from one
resource to another. These resources can be located online, offline, or within the local file system.
The anchor tag requires the href attribute, which defines the destination URL or path of the link.
Syntax
<a href="URL">Link Text</a>
VSCode: a enter
Types of anchor tag:
Anchor tags can be categorized into three types based on the location of the linked resource:
Online Anchor tag:
An online anchor tag links to an external website or online resource. An active internet connection is
required to access the destination.
<a href="https://www.example.com">Visit Example</a>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Anchor Tag/ Link Tag</title>
</head>
<body>
<a href="https://www.youtube.com/watch?v=KUMWIFi4HCHE">HTML Full Course</a>
</body>
</html>
CAC HTML
3rd FLOOR, PRIYADARSHINI MARKET Satya Sir
CRPF SQUARE, BBSR, 751012
+91 9437089830
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Anchor Tag/ Link Tag</title>
</head>
<body>
<a href="index2.html">Satya Profile</a>
</body>
</html>
CAC HTML
3rd FLOOR, PRIYADARSHINI MARKET Satya Sir
CRPF SQUARE, BBSR, 751012
+91 9437089830
Target attributes Anchor tag:
Target attributes decide how the page will open in the tab.
Mainly it has 3 values
target="_blank": Opens the link in a new tab or window.
target="_self": Opens the link in the same tab (default behavior).
target="_parent": Opens the link in the parent frame, if the page is within a nested frame.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Anchor Tag/ Link Tag</title>
</head>
<body>
<a href="https://www.cac.edu.in" target="_blank">Go to CAC</a>
</body>
</html>
CAC HTML
3rd FLOOR, PRIYADARSHINI MARKET Satya Sir
CRPF SQUARE, BBSR, 751012
+91 9437089830
Module 6: HTML LIST
Introduction
HTML, a list tag is used to display a group of related items in a structured format. Lists help organize
content clearly and improve readability for users. Mainly it is used to store data in listed format.
It is denoted with <li>…</li>. Before the list begins, we must specify the type of the list.
Types of the list
We mainly have 3 types of list present in HTML such as Unordered List, Ordered List, Definition List
a) Unordered List(ul):
These lists have no specific order and is displayed in a bullet point. It is denoted with <ul>…</ul>.
Syntax:
<ul>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
</ul>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<!-- unordered list example -->
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JS</li>
<li>BOOTSTRAP</li>
<li>PYTHON</li>
<li>DJANGO</li>
<li>Digital Marketing</li>
</ul>
<!-- unordered list example -->
</body>
</html>
CAC HTML
3rd FLOOR, PRIYADARSHINI MARKET Satya Sir
CRPF SQUARE, BBSR, 751012
+91 9437089830
b) Unordered List(ol):
These lists having specific order and is displayed in a nueric point. It is denoted with <ol>…</ol>.
Syntax:
<ol>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
</ol>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<!-- ordered list example -->
<ol>
<li>HTML</li>
<li>CSS</li>
<li>JS</li>
<li>BOOTSTRAP</li>
<li>PYTHON</li>
<li>DJANGO</li>
<li>Digital Marketing</li>
</ol>
<!-- ordered list example -->
</body>
</html>
c) Definition List(dl):
These lists having some term and description.
Syntax:
<dl>
<dt>…</dt>
<dd>…</dd>
</dl>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
CAC HTML
3rd FLOOR, PRIYADARSHINI MARKET Satya Sir
CRPF SQUARE, BBSR, 751012
+91 9437089830
<!-- Definition list example -->
<dl>
<dt>HTMl</dt>
<dd> Lorem ipsum dolor sit amet consectetur adipisicing elit. Corporis repellendus
eveniet ipsa voluptatum placeat quasi asperiores labore veniam autem, explicabo iure. At,
voluptates alias veritatis animi ea iusto sint aut quae pariatur quis mollitia magnam vitae
sit consequuntur vero corrupti maiores dolor possimus dignissimos reiciendis?</dd>
</dl>
<!-- Definition list example -->
</body>
</html>
CAC HTML
3rd FLOOR, PRIYADARSHINI MARKET Satya Sir
CRPF SQUARE, BBSR, 751012
+91 9437089830