SlideShare a Scribd company logo
12
Most read
18
Most read
24
Most read
HTML, CSS,
JAVASCRIPT
For Beginners
Prakriti Dhang
22-06-2020
HTML
Hyper Text Markup Language
HTML
• Abbreviation for Hyper Text Markup Language
• Is the standard markup language for creating web pages.
• Easy to understand
• Well Organized
• Front-end programming language
• saved with a .html extension
HTML elements
• HTML elements has starting tag, contents and closing tag
<tagname> content </tagname>
• The closing tag ends with a backslash (/).
• The start tag and close tag name should be same.
• <h1> content </h1>
HTML elements
• <!DOCTYPE html> defines that this document is an
HTML5 document.
• <html> element is the root element of an HTML page
• <head> element contains meta information about the
HTML page
• <title> element specifies a title for the HTML page (shown
in the browser's title bar)
• <body> element defines the document's body.
• The <h1> element defines a large heading
• The <p> element defines a paragraph
Body elements
• Body tag contains all the visible contents,
 Headings (h1-h6),
 Paragraphs,
 Images,
 Hyperlinks,
 Tables,
 Lists, etc.
Example
• <!DOCTYPE html>
• <html>
• <head>
• <title> Example 1</title>
• </head>
• <body>
• <h1> WELCOME! </h1>
• <p>Welcome to my first page.</p>
• </body>
• </html>
CSS
Cascading Style Sheet
CSS
• CSS Stands for Cascading Style Sheets
• Easy to understand
• Well Organized
• Front-end programming language
• saved with a .css extension when use external CSS.
CSS syntax
h1 {
color: yellow;
text-align: center;
}
• <h1> is the selector in CSS.
• Color is the property and yellow is the value.
• Text-align is the property and center is the value
Ways to insert CSS
• There are 3 ways to insert CSS:
1. Internal: The internal style is defined inside the
<style> element, inside the head section.
2. External: Can be written in any text editor, and
must be saved with a .css extension. The external
.css file should not contain any HTML tags.
3. Inline: add the style attribute to the element. The
style attribute can contain any CSS property.
Internal CSS
• <!DOCTYPE html>
• <html>
• <head>
• <title> Example 1 </title>
• <style>
• body {
• background-color: lightgreen;
• }
• h1 {
• color: yellow;
• text-align: center;
• }
• p {
• font-family: Arial;
• font-size: 20px;
• font-style:italic;
• }
• </style>
• </head>
• <body>
• <h1> WELCOME! </h1>
• <p>Welcome to my first page.</p>
• </body>
• </html>
External CSS
In Example.html
<!DOCTYPE html>
<html>
<head>
<title>Example 1</title>
<link rel="stylesheet" type="text/css"
href=“stylesheet1.css">
</head>
<body>
<h1> WELCOME! </h1>
<p>Welcome to my first page.</p>
</body>
</html>
In stylesheet.css
body {
background-color: lightgreen;
}
h1 {
color: yellow;
text-align: center;
}
p {
font-family: Arial;
font-size: 20px;
font-style:italic;
}
Inline CSS
<!DOCTYPE html>
<html>
<body style="background-color: lightgreen;">
<h1 style="color:yellow;text-align:center;">This is a
heading</h1>
<p style="font-family: Arial; font-size: 20px; font-
style:italic; ">This is a paragraph.</p>
</body>
</html>
CSS selectors
1. Id selector:
• The id of an element is unique within a page.
• The id selector is used to select one unique element.
• Write a hash (#) character, before the id of the element.
2. Class selector:
• The class selector selects HTML elements with a specific
class attribute.
• To select elements with a specific class, write a dot (.)
character, before the class name.
Example
• <!DOCTYPE html>
• <html>
• <head>
• <title> Example 2</title>
• <style>
• body {
• background-color: lightgreen;
• }
• #head1 {
• color: yellow;
• text-align: center;
• }
• .para1{
• font-family: Arial;
• font-size: 20px;
• font-style:italic;
• }
• </style>
• </head>
• <body>
• <h1 id=“head1”> WELCOME! </h1>
• <p class=“para1”>Welcome to my first page.</p>
• </body>
• </html>
JAVASCRIPT
JavaScript
• Is a programming language
• Is used for creating websites
• Easy to learn.
• Standalone language
• Used to make dynamic webpages
• Add special effects on webpages like rollover, roll out and
many types of graphics.
• saved with a .js extension.
Inline JavaScript
• <!DOCTYPE html>
• <html>
• <head>
• <title> Example 1</title>
• <style>
• body {
• background-color: lightgreen;
• }
• #head1{
• color: yellow;
• text-align: center;
• }
• .para1 {
• font-family: Arial;
• font-size: 20px;
• font-style:italic;
• }
• </style>
• </head>
• <body>
• <h1 id="head1"> WELCOME! </h1>
• <p class="para1">Welcome to my first page.</p>
• <h2 id="head2"></h2>
• <button type="button" onclick='document.getElementById("head2").innerHTML = "This is JavaScript!"'>Click Me!</button>
• </body>
• </html>
Internal JavaScript
• <!DOCTYPE html>
• <html>
• <head>
• <title> Example 1</title>
• <style>
• body {
• background-color: lightgreen;
• }
• #head1{
• color: yellow;
• text-align: center;
• }
• .para1 {
• font-family: Arial;
• font-size: 20px;
• font-style:italic;
• }
• </style>
• <script>
• function clickme(){
• document.getElementById("head2").innerHTML = "This is JavaScript";
• }
• </script>
• </head>
• <body>
• <h1 id="head1"> WELCOME! </h1>
• <p class="para1">Welcome to my first page.</p>
• <h2 id="head2"> </h2>
• <button type="button" onclick="clickme()">Click Me!</button>
• </body>
• </html>
External JavaScript
• <!DOCTYPE html>
• <html>
• <head>
• <title> Example 1</title>
• <script type="text/javascript" src="exjse.js"></script>
• <style>
• body {
• background-color: lightgreen;
• }
• #head1{
• color: yellow;
• text-align: center;
• }
• .para1 {
• font-family: Arial;
• font-size: 20px;
• font-style:italic;
• }
• </style>
• </head>
• <body>
• <h1 id="head1"> WELCOME! </h1>
• <p class="para1">Welcome to my first page.</p>
• <h2 id="head2"> </h2>
• <button type="button" onclick="clickme()">Click Me!</button>
• </body>
• </html>
Add this code in a new file and name as exjse.js
function clickme(){
document.getElementById("head2").innerHTML
= "This is JavaScript";
}
Practice
1. Create a web page with a title “My tour”
• Use heading size 2, “My trip to ….” . Add a paragraph
and write about the place. Your name should be in
head size 4.
• Use external css. Add text color to both headings and
paragraph, the heading should be in bold and
paragraph should be in italics. Add background color
to light blue.
• Use external JavaScript, when clicking the button, it
should display your name.
In Next Lesson we will learn
• How to use lists, tables, images and hyperlinks.
• Use javascript to resize image size.
Thank You

More Related Content

What's hot (20)

PPTX
Html
yugank_gupta
 
PPT
Html basics
mcatahir947
 
ODP
CSS Basics
Sanjeev Kumar
 
PPTX
Html ppt
Ruchi Kumari
 
PPTX
Basic HTML
Sayan De
 
PPTX
Css
Hemant Saini
 
PDF
Html,javascript & css
Predhin Sapru
 
PDF
Html / CSS Presentation
Shawn Calvert
 
PDF
Introduction to HTML and CSS
Mario Hernandez
 
PDF
Intro to HTML and CSS basics
Eliran Eliassy
 
PPTX
Basic Html Knowledge for students
vethics
 
PDF
Intro to HTML & CSS
Syed Sami
 
PPTX
Html coding
Briana VanBuskirk
 
PPTX
HTML-(workshop)7557.pptx
Raja980775
 
PPTX
Html 5
manujayarajkm
 
PPT
Introduction to CSS
Amit Tyagi
 
PDF
HTML5: features with examples
Alfredo Torre
 
Html basics
mcatahir947
 
CSS Basics
Sanjeev Kumar
 
Html ppt
Ruchi Kumari
 
Basic HTML
Sayan De
 
Html,javascript & css
Predhin Sapru
 
Html / CSS Presentation
Shawn Calvert
 
Introduction to HTML and CSS
Mario Hernandez
 
Intro to HTML and CSS basics
Eliran Eliassy
 
Basic Html Knowledge for students
vethics
 
Intro to HTML & CSS
Syed Sami
 
Html coding
Briana VanBuskirk
 
HTML-(workshop)7557.pptx
Raja980775
 
Introduction to CSS
Amit Tyagi
 
HTML5: features with examples
Alfredo Torre
 

Similar to HTML, CSS, JavaScript for beginners (20)

PDF
6. Css
Gao Fuyan
 
PDF
What is HTML - An Introduction to HTML (Hypertext Markup Language)
Ahsan Rahim
 
PPTX
Html and Css Student Education hub point.pptx
AbenezerTefera2
 
PPT
Basics ogHtml
rohitkumar2468
 
PPTX
Unit2_2024.pptx are related to PHP HTML CSS
abhinandankondekar2
 
PPTX
VAIBHAV JAIN WEB TECHNOLOGY.pptx
VAIBHAV481101
 
PPTX
html document। .pptx
ayanshaikh0054
 
PPTX
Web Dev Essential 1web dev using HTML DHTML.pptx
mohiburrehmanbkt
 
PPTX
uptu web technology unit 2 html
Abhishek Kesharwani
 
PPTX
Java script and html new
Malik M. Ali Shahid
 
PPTX
Java script and html
Malik M. Ali Shahid
 
PDF
Intro to HTML
Gerson Abesamis
 
PDF
Quan Head Tag Presentation
Quanslides
 
PPTX
presentation_web_design_basic_1595487867_382444.pptx
ssuser3a64ac
 
PPT
Html
Bhumika Ratan
 
PPTX
2. HTML Basic unit2 fundamentals of computer
travelwithlifezindgi
 
PPT
Introduction to HTML table,width,height.ppt
ArunPatrick2
 
PPTX
DESIGN THINKING SYLLABUS MATERIAL NOTES UNIT 1 .pptx
bmit1
 
6. Css
Gao Fuyan
 
What is HTML - An Introduction to HTML (Hypertext Markup Language)
Ahsan Rahim
 
Html and Css Student Education hub point.pptx
AbenezerTefera2
 
Basics ogHtml
rohitkumar2468
 
Unit2_2024.pptx are related to PHP HTML CSS
abhinandankondekar2
 
VAIBHAV JAIN WEB TECHNOLOGY.pptx
VAIBHAV481101
 
html document। .pptx
ayanshaikh0054
 
Web Dev Essential 1web dev using HTML DHTML.pptx
mohiburrehmanbkt
 
uptu web technology unit 2 html
Abhishek Kesharwani
 
Java script and html new
Malik M. Ali Shahid
 
Java script and html
Malik M. Ali Shahid
 
Intro to HTML
Gerson Abesamis
 
Quan Head Tag Presentation
Quanslides
 
presentation_web_design_basic_1595487867_382444.pptx
ssuser3a64ac
 
2. HTML Basic unit2 fundamentals of computer
travelwithlifezindgi
 
Introduction to HTML table,width,height.ppt
ArunPatrick2
 
DESIGN THINKING SYLLABUS MATERIAL NOTES UNIT 1 .pptx
bmit1
 
Ad

Recently uploaded (20)

PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PDF
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PPTX
How to Manage Allocation Report for Manufacturing Orders in Odoo 18
Celine George
 
PPTX
TRANSLATIONAL AND ROTATIONAL MOTION.pptx
KIPAIZAGABAWA1
 
PPTX
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PDF
epi editorial commitee meeting presentation
MIPLM
 
PPTX
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
PPTX
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
PPTX
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
PDF
Council of Chalcedon Re-Examined
Smiling Lungs
 
PPTX
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
Mahidol_Change_Agent_Note_2025-06-27-29_MUSEF
Tassanee Lerksuthirat
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
Horarios de distribución de agua en julio
pegazohn1978
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
How to Manage Allocation Report for Manufacturing Orders in Odoo 18
Celine George
 
TRANSLATIONAL AND ROTATIONAL MOTION.pptx
KIPAIZAGABAWA1
 
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
epi editorial commitee meeting presentation
MIPLM
 
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
Council of Chalcedon Re-Examined
Smiling Lungs
 
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
Ad

HTML, CSS, JavaScript for beginners

  • 3. HTML • Abbreviation for Hyper Text Markup Language • Is the standard markup language for creating web pages. • Easy to understand • Well Organized • Front-end programming language • saved with a .html extension
  • 4. HTML elements • HTML elements has starting tag, contents and closing tag <tagname> content </tagname> • The closing tag ends with a backslash (/). • The start tag and close tag name should be same. • <h1> content </h1>
  • 5. HTML elements • <!DOCTYPE html> defines that this document is an HTML5 document. • <html> element is the root element of an HTML page • <head> element contains meta information about the HTML page • <title> element specifies a title for the HTML page (shown in the browser's title bar) • <body> element defines the document's body. • The <h1> element defines a large heading • The <p> element defines a paragraph
  • 6. Body elements • Body tag contains all the visible contents,  Headings (h1-h6),  Paragraphs,  Images,  Hyperlinks,  Tables,  Lists, etc.
  • 7. Example • <!DOCTYPE html> • <html> • <head> • <title> Example 1</title> • </head> • <body> • <h1> WELCOME! </h1> • <p>Welcome to my first page.</p> • </body> • </html>
  • 9. CSS • CSS Stands for Cascading Style Sheets • Easy to understand • Well Organized • Front-end programming language • saved with a .css extension when use external CSS.
  • 10. CSS syntax h1 { color: yellow; text-align: center; } • <h1> is the selector in CSS. • Color is the property and yellow is the value. • Text-align is the property and center is the value
  • 11. Ways to insert CSS • There are 3 ways to insert CSS: 1. Internal: The internal style is defined inside the <style> element, inside the head section. 2. External: Can be written in any text editor, and must be saved with a .css extension. The external .css file should not contain any HTML tags. 3. Inline: add the style attribute to the element. The style attribute can contain any CSS property.
  • 12. Internal CSS • <!DOCTYPE html> • <html> • <head> • <title> Example 1 </title> • <style> • body { • background-color: lightgreen; • } • h1 { • color: yellow; • text-align: center; • } • p { • font-family: Arial; • font-size: 20px; • font-style:italic; • } • </style> • </head> • <body> • <h1> WELCOME! </h1> • <p>Welcome to my first page.</p> • </body> • </html>
  • 13. External CSS In Example.html <!DOCTYPE html> <html> <head> <title>Example 1</title> <link rel="stylesheet" type="text/css" href=“stylesheet1.css"> </head> <body> <h1> WELCOME! </h1> <p>Welcome to my first page.</p> </body> </html> In stylesheet.css body { background-color: lightgreen; } h1 { color: yellow; text-align: center; } p { font-family: Arial; font-size: 20px; font-style:italic; }
  • 14. Inline CSS <!DOCTYPE html> <html> <body style="background-color: lightgreen;"> <h1 style="color:yellow;text-align:center;">This is a heading</h1> <p style="font-family: Arial; font-size: 20px; font- style:italic; ">This is a paragraph.</p> </body> </html>
  • 15. CSS selectors 1. Id selector: • The id of an element is unique within a page. • The id selector is used to select one unique element. • Write a hash (#) character, before the id of the element. 2. Class selector: • The class selector selects HTML elements with a specific class attribute. • To select elements with a specific class, write a dot (.) character, before the class name.
  • 16. Example • <!DOCTYPE html> • <html> • <head> • <title> Example 2</title> • <style> • body { • background-color: lightgreen; • } • #head1 { • color: yellow; • text-align: center; • } • .para1{ • font-family: Arial; • font-size: 20px; • font-style:italic; • } • </style> • </head> • <body> • <h1 id=“head1”> WELCOME! </h1> • <p class=“para1”>Welcome to my first page.</p> • </body> • </html>
  • 18. JavaScript • Is a programming language • Is used for creating websites • Easy to learn. • Standalone language • Used to make dynamic webpages • Add special effects on webpages like rollover, roll out and many types of graphics. • saved with a .js extension.
  • 19. Inline JavaScript • <!DOCTYPE html> • <html> • <head> • <title> Example 1</title> • <style> • body { • background-color: lightgreen; • } • #head1{ • color: yellow; • text-align: center; • } • .para1 { • font-family: Arial; • font-size: 20px; • font-style:italic; • } • </style> • </head> • <body> • <h1 id="head1"> WELCOME! </h1> • <p class="para1">Welcome to my first page.</p> • <h2 id="head2"></h2> • <button type="button" onclick='document.getElementById("head2").innerHTML = "This is JavaScript!"'>Click Me!</button> • </body> • </html>
  • 20. Internal JavaScript • <!DOCTYPE html> • <html> • <head> • <title> Example 1</title> • <style> • body { • background-color: lightgreen; • } • #head1{ • color: yellow; • text-align: center; • } • .para1 { • font-family: Arial; • font-size: 20px; • font-style:italic; • } • </style> • <script> • function clickme(){ • document.getElementById("head2").innerHTML = "This is JavaScript"; • } • </script> • </head> • <body> • <h1 id="head1"> WELCOME! </h1> • <p class="para1">Welcome to my first page.</p> • <h2 id="head2"> </h2> • <button type="button" onclick="clickme()">Click Me!</button> • </body> • </html>
  • 21. External JavaScript • <!DOCTYPE html> • <html> • <head> • <title> Example 1</title> • <script type="text/javascript" src="exjse.js"></script> • <style> • body { • background-color: lightgreen; • } • #head1{ • color: yellow; • text-align: center; • } • .para1 { • font-family: Arial; • font-size: 20px; • font-style:italic; • } • </style> • </head> • <body> • <h1 id="head1"> WELCOME! </h1> • <p class="para1">Welcome to my first page.</p> • <h2 id="head2"> </h2> • <button type="button" onclick="clickme()">Click Me!</button> • </body> • </html> Add this code in a new file and name as exjse.js function clickme(){ document.getElementById("head2").innerHTML = "This is JavaScript"; }
  • 22. Practice 1. Create a web page with a title “My tour” • Use heading size 2, “My trip to ….” . Add a paragraph and write about the place. Your name should be in head size 4. • Use external css. Add text color to both headings and paragraph, the heading should be in bold and paragraph should be in italics. Add background color to light blue. • Use external JavaScript, when clicking the button, it should display your name.
  • 23. In Next Lesson we will learn • How to use lists, tables, images and hyperlinks. • Use javascript to resize image size.