SlideShare a Scribd company logo
INTRODUCTION TO
HTML & CSS
Presented by : Rajeev khatri
OUTLINE
• Introduction
• HTML
• CSS – a brief introduction
What Is HTML ?
• HTML is the language of the web (Hyper Text Markup Language) .
• Every internet browser can interpret and display HTML documents .
• In reality HTML is just a stream of text that is formatted and displayed for you on the
screen by the web browser .
• HTML documents consist of a series of pairs of tags often with text and other tags in
between the tags .
• A tag pair has an opening tag and a closing tag .
• HTML tags are contained within <> (chevrons) .
• An opening tag is like this .
• A closing tag is like this .
• Tags should match (generally) .
• HTML documents can be written in files with the postfix ‘.html’ .
HTML Code
• Visit a web page that you like
• Right click on the page
• Select the ‘View Source’ option
• This is what the web server sends back to the browser
• The browser interprets and displays it
HTML Example Page 1
<! Doctype html>
<html>
<head>
<title>First web page</title>
</head>
<body>
My First web page
</body>
</html>
HTML Tags
• Hyperlink tag;
<a href= “target url”>Link Text</a>
• Headings
• <h1>Big Heading</h1>
• <h2>Smaller Heading</h2>
• <h3>Even Smaller Heading</h3>
• Text
• <p>Paragraph</p>
• <i>Italic</i>
• <u>underline</u>
• <br>newline tag
• <hr>horizontal rule(line) across page
Make the page below in your file using
the html tags we have just seen
HTML Tables
• Tables are a very useful way of visual information
• Tables have rows and columns
• The tags are;
• <table></table> : outer table tags
• <th></th> : table heading row(for the first row of the table only)
• <tr></tr> : for a normal table row
• <td></td> : for a table element
A Very Simple Table
<!DOCTYPE html>
<html>
<head>
<meta charset=”IOS-8859-1”
<TITLE>My first Table</title>
</head>
<body>
<table border=1>
<tr>
<th>Column 1 Head</th>
<th>Column 2 head</th>
</tr>
<tr>
<td>Column 1 Row 1 Data</td>
<td>Column 1 Row 2 Data</td>
</tr>
</table>
</body>
</html>
HTML Forms
• Information can be sent back to the server via web forms .
• Web forms consist of web page components that capture information .
Form Tag
• All components in a form are contained within the tag .
• The opening form tag will usually look something like this;
• <form action=“hospitals.html” method=“POST”
• The action attribute is the address of the web page where information is sent
• The method attribute is the type of request that is sent to the server,
POST is almost always used with forms
Common Form Elements – Inside the
<form></form> tags
TEXT
• Text Input
<input type=“text” name=“username” id=“username” value=“ctomlins” />
• Password Input
<input type=“password” name=“pass” id=“pass” value=“mypassword” />
• Text Area
<textarea id=“textareainput” name =“textareainput” rows=“5” cols=“30” >
Text inside the text area goes between the tags
</textarea>
Login Form
<FORM ACTION=login.html METHOD=POST>
<TR>
<TD>Username</TD>
<TD>
<INPUT NAME="username" ID="username" TYPE="EDIT" SIZE=50 MAXLENGTH=50 VALUE=""></TD>
</TR>
<TR>
<TD>Password</TD>
<TD>
<INPUT NAME="password" ID="password" TYPE="PASSWORD" SIZE=50 MAXLENGTH 50 VALUE="">
</TD>
</TR>
<TR>
<TD>Submit</TD>
<TD>
<INPUT NAME="submit" TYPE="SUBMIT" VALUE="Login">
</TD>
</TR>
</FORM>
Form Elements – Selectors Pull Down List
<SELECT NAME=team_id ID=team_id>
<OPTION VALUE=1>Alvin and the Chipmunks</OPTION>
<OPTION VALUE=2>Fantastic Five</OPTION>
<OPTION VALUE=3>Serious Quiz Leaders</OPTION>
</SELECT>
Form Elements : Checkbox
<input id="molec_conf_1" name="molec_conf_1“ type="CHECKBOX“ value="1“
checked>
<input id="molec_conf_2" name="molec_conf_2" type="CHECKBOX" value="1">
Form Elements : Submit Button
• Pressing the submit button on a web form sends the information in it to the
server .
• The http address that the information is sent to is taken from the ACTION
attribute of the form tag .
Form Elements : Submit Button
<FORM ACTION=login.html METHOD=POST>
<TR>
<TD WIDTH = 25% ALIGN=left VALIGN=top BGCOLOR=#ffffff COLSPAN=1>Username</TD>
<TD WIDTH = 75% ALIGN=left VALIGN=top BGCOLOR=#ffffff COLSPAN=1>
<INPUT NAME="username" ID="username" TYPE="EDIT" SIZE=50 MAXLENGTH=50 VALUE="">
</TD>
</TR>
<TR>
<TD WIDTH=25% ALIGN=left VALIGN=top BGCOLOR=#ffffff COLSPAN=1>Password</TD>
<TD WIDTH = 75% ALIGN=left VALIGN=top BGCOLOR=#ffffff COLSPAN=1>
<INPUT NAME="password" ID="password" TYPE="PASSWORD" SIZE=50 MAXLENGTH=50 VALUE="">
</TD>
</TR>
<TR>
<TD WIDTH = 25% ALIGN=left VALIGN=top BGCOLOR=#ffffff COLSPAN=1>Submit</TD>
<TD WIDTH = 75% ALIGN=left VALIGN=top BGCOLOR=#ffffff COLSPAN=1>
<INPUT NAME="submit" TYPE="SUBMIT" VALUE="Login">
</TD>
</TR>
</FORM>
HTML Summary
• HTML is a syntax for formatting internet content .
• Page content is placed inside nested html tags that contain formatting
information for the browser .
• Html forms allow a developer to make interactive web content, with
information being sent back to the web server .
HTML Page Structure Document Object
Model (DOM)
What Is CSS ?
• CSS stands for Cascading Style Sheets .
• CSS describes how HTML elements are to be displayed on screen, paper, or in
other media .
• CSS saves a lot of work. It can control the layout of multiple web pages all at
once .
• External stylesheets are stored in CSS files .
Types Of CSS
• CSS commands can be applied to a page in three ways;
• In line as a part of HTML tags
• Inside a page defined inside a tag
• In a separate file that a web page accesses
CSS Syntax
Inline CSS
• Inside a tag the style property is added and css directives are added inside
quotes
• The format of the css is <property>:<value>
• More than one css property can be separated by a semicolon
• We have already seen an example of this;
<div style="color:#0000FF">
<h3>This is a heading</h3>
<p>This is a paragraph.</p>
</div>
• Text within the div will be displayed in blue
CSS : Using an included File
• It is a good idea to completely separate the css from the HTML by putting the
css code in a separate file.
web page Header HTML
<HEAD>
<TITLE>Computer Skills for Bioinformatics</TITLE>
<LINK media=all
href="https://dataman.bioinformatics.ic.ac.uk/computer skills/css/style.css"
type=text/css rel-stylesheet>
</HEAD>
Web Page
CSS : apply a style to an id
In the css file you will have seen many items like this;
#content {MARGIN-LEFT: 180px; WIDTH: 720px; MARGIN-RIGHT: 100px
• This will apply the css to the section of the html with the id content
<div id="content">
elements in here have css style content applied tothem
</div>
css apply a style to more than one
element
• The values of id attributes have to be unique by their natureIf you want to
apply a style to more than one element then you can use the class attribute of a
tag .
• <div class="data-table"> ... </div>
• <table class="data-table"> ... </table>
css : apply style using class
• These correspond to the .data-table directives at the bottom of the css file;
• So whenever data-table is included as a class attribute the css rules are
applied .
• This can be applied to many elements on a page .
Apply a CSS class to your form table
<!doctype>
<html>
<head>
<title>2019 Fourth Quarter Report</title>
<link href="styles.css" rel="stylesheet" media="all" />
</head>
<body>
<table>
</table>
</body>
</html>
Working with multiple devices :
Bootstrap
Demonstration
INTRODUCTION TO HTML & CSS .pptx
The End

More Related Content

PPTX
An Overview of HTML, CSS & Java Script
PPTX
Introduction to Web Techniques_Key componenets_HTML Basics
PPTX
PPTX
PPTX
Html starting
PDF
WEB DESIGN AND INTERNET PROGRAMMING LAB MANUAL.pdf
PPTX
Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJS
An Overview of HTML, CSS & Java Script
Introduction to Web Techniques_Key componenets_HTML Basics
Html starting
WEB DESIGN AND INTERNET PROGRAMMING LAB MANUAL.pdf
Basic of HTML, CSS(StyleSheet), JavaScript(js), Bootstrap, JSON & AngularJS

Similar to INTRODUCTION TO HTML & CSS .pptx (20)

PPTX
Entering User Data from a Web Page HTML Forms
PDF
Html tutorials by www.dmdiploma.com
PDF
WEB DESIGNING.pdf
PDF
Thinkful - Frontend Crash Course - Intro to HTML/CSS
PDF
Web designing
PPTX
Learn html and css from scratch
PDF
Html css crash course may 11th, atlanta
PPT
HTML BY JODY C SALAS
PPTX
Workshop 2 Slides.pptx
PPTX
PDF
Html:css crash course (4:5)
PPTX
HTML/CSS/java Script/Jquery
PPTX
Lab1_HTML.pptx
PPTX
Web development (html)
PPTX
HTML [Basic] --by Abdulla-al Baset
PDF
Code &amp; design your first website (3:16)
PDF
FED-HTML (2).pdf
PDF
Code & Design your first website 4/18
PPTX
HTML - HYPERTEXT MARKUP LANGUAGE AND ITS DIFFERENT ELEMENTS
Entering User Data from a Web Page HTML Forms
Html tutorials by www.dmdiploma.com
WEB DESIGNING.pdf
Thinkful - Frontend Crash Course - Intro to HTML/CSS
Web designing
Learn html and css from scratch
Html css crash course may 11th, atlanta
HTML BY JODY C SALAS
Workshop 2 Slides.pptx
Html:css crash course (4:5)
HTML/CSS/java Script/Jquery
Lab1_HTML.pptx
Web development (html)
HTML [Basic] --by Abdulla-al Baset
Code &amp; design your first website (3:16)
FED-HTML (2).pdf
Code & Design your first website 4/18
HTML - HYPERTEXT MARKUP LANGUAGE AND ITS DIFFERENT ELEMENTS
Ad

Recently uploaded (20)

PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Current and future trends in Computer Vision.pptx
PPT
Mechanical Engineering MATERIALS Selection
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
composite construction of structures.pdf
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Well-logging-methods_new................
PDF
PPT on Performance Review to get promotions
PDF
Digital Logic Computer Design lecture notes
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
CH1 Production IntroductoryConcepts.pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPT
Project quality management in manufacturing
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
UNIT 4 Total Quality Management .pptx
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
OOP with Java - Java Introduction (Basics)
Current and future trends in Computer Vision.pptx
Mechanical Engineering MATERIALS Selection
R24 SURVEYING LAB MANUAL for civil enggi
composite construction of structures.pdf
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Well-logging-methods_new................
PPT on Performance Review to get promotions
Digital Logic Computer Design lecture notes
Operating System & Kernel Study Guide-1 - converted.pdf
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
CH1 Production IntroductoryConcepts.pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Project quality management in manufacturing
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
UNIT 4 Total Quality Management .pptx
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Ad

INTRODUCTION TO HTML & CSS .pptx

  • 1. INTRODUCTION TO HTML & CSS Presented by : Rajeev khatri
  • 2. OUTLINE • Introduction • HTML • CSS – a brief introduction
  • 3. What Is HTML ? • HTML is the language of the web (Hyper Text Markup Language) . • Every internet browser can interpret and display HTML documents . • In reality HTML is just a stream of text that is formatted and displayed for you on the screen by the web browser . • HTML documents consist of a series of pairs of tags often with text and other tags in between the tags . • A tag pair has an opening tag and a closing tag . • HTML tags are contained within <> (chevrons) . • An opening tag is like this . • A closing tag is like this . • Tags should match (generally) . • HTML documents can be written in files with the postfix ‘.html’ .
  • 4. HTML Code • Visit a web page that you like • Right click on the page • Select the ‘View Source’ option • This is what the web server sends back to the browser • The browser interprets and displays it
  • 5. HTML Example Page 1 <! Doctype html> <html> <head> <title>First web page</title> </head> <body> My First web page </body> </html>
  • 6. HTML Tags • Hyperlink tag; <a href= “target url”>Link Text</a> • Headings • <h1>Big Heading</h1> • <h2>Smaller Heading</h2> • <h3>Even Smaller Heading</h3> • Text • <p>Paragraph</p> • <i>Italic</i> • <u>underline</u> • <br>newline tag • <hr>horizontal rule(line) across page
  • 7. Make the page below in your file using the html tags we have just seen
  • 8. HTML Tables • Tables are a very useful way of visual information • Tables have rows and columns • The tags are; • <table></table> : outer table tags • <th></th> : table heading row(for the first row of the table only) • <tr></tr> : for a normal table row • <td></td> : for a table element
  • 9. A Very Simple Table <!DOCTYPE html> <html> <head> <meta charset=”IOS-8859-1” <TITLE>My first Table</title> </head> <body> <table border=1> <tr> <th>Column 1 Head</th> <th>Column 2 head</th> </tr> <tr> <td>Column 1 Row 1 Data</td> <td>Column 1 Row 2 Data</td> </tr> </table> </body> </html>
  • 10. HTML Forms • Information can be sent back to the server via web forms . • Web forms consist of web page components that capture information .
  • 11. Form Tag • All components in a form are contained within the tag . • The opening form tag will usually look something like this; • <form action=“hospitals.html” method=“POST” • The action attribute is the address of the web page where information is sent • The method attribute is the type of request that is sent to the server, POST is almost always used with forms
  • 12. Common Form Elements – Inside the <form></form> tags TEXT • Text Input <input type=“text” name=“username” id=“username” value=“ctomlins” /> • Password Input <input type=“password” name=“pass” id=“pass” value=“mypassword” /> • Text Area <textarea id=“textareainput” name =“textareainput” rows=“5” cols=“30” > Text inside the text area goes between the tags </textarea>
  • 13. Login Form <FORM ACTION=login.html METHOD=POST> <TR> <TD>Username</TD> <TD> <INPUT NAME="username" ID="username" TYPE="EDIT" SIZE=50 MAXLENGTH=50 VALUE=""></TD> </TR> <TR> <TD>Password</TD> <TD> <INPUT NAME="password" ID="password" TYPE="PASSWORD" SIZE=50 MAXLENGTH 50 VALUE=""> </TD> </TR> <TR> <TD>Submit</TD> <TD> <INPUT NAME="submit" TYPE="SUBMIT" VALUE="Login"> </TD> </TR> </FORM>
  • 14. Form Elements – Selectors Pull Down List <SELECT NAME=team_id ID=team_id> <OPTION VALUE=1>Alvin and the Chipmunks</OPTION> <OPTION VALUE=2>Fantastic Five</OPTION> <OPTION VALUE=3>Serious Quiz Leaders</OPTION> </SELECT>
  • 15. Form Elements : Checkbox <input id="molec_conf_1" name="molec_conf_1“ type="CHECKBOX“ value="1“ checked> <input id="molec_conf_2" name="molec_conf_2" type="CHECKBOX" value="1">
  • 16. Form Elements : Submit Button • Pressing the submit button on a web form sends the information in it to the server . • The http address that the information is sent to is taken from the ACTION attribute of the form tag .
  • 17. Form Elements : Submit Button <FORM ACTION=login.html METHOD=POST> <TR> <TD WIDTH = 25% ALIGN=left VALIGN=top BGCOLOR=#ffffff COLSPAN=1>Username</TD> <TD WIDTH = 75% ALIGN=left VALIGN=top BGCOLOR=#ffffff COLSPAN=1> <INPUT NAME="username" ID="username" TYPE="EDIT" SIZE=50 MAXLENGTH=50 VALUE=""> </TD> </TR> <TR> <TD WIDTH=25% ALIGN=left VALIGN=top BGCOLOR=#ffffff COLSPAN=1>Password</TD> <TD WIDTH = 75% ALIGN=left VALIGN=top BGCOLOR=#ffffff COLSPAN=1> <INPUT NAME="password" ID="password" TYPE="PASSWORD" SIZE=50 MAXLENGTH=50 VALUE=""> </TD> </TR> <TR> <TD WIDTH = 25% ALIGN=left VALIGN=top BGCOLOR=#ffffff COLSPAN=1>Submit</TD> <TD WIDTH = 75% ALIGN=left VALIGN=top BGCOLOR=#ffffff COLSPAN=1> <INPUT NAME="submit" TYPE="SUBMIT" VALUE="Login"> </TD> </TR> </FORM>
  • 18. HTML Summary • HTML is a syntax for formatting internet content . • Page content is placed inside nested html tags that contain formatting information for the browser . • Html forms allow a developer to make interactive web content, with information being sent back to the web server .
  • 19. HTML Page Structure Document Object Model (DOM)
  • 20. What Is CSS ? • CSS stands for Cascading Style Sheets . • CSS describes how HTML elements are to be displayed on screen, paper, or in other media . • CSS saves a lot of work. It can control the layout of multiple web pages all at once . • External stylesheets are stored in CSS files .
  • 21. Types Of CSS • CSS commands can be applied to a page in three ways; • In line as a part of HTML tags • Inside a page defined inside a tag • In a separate file that a web page accesses
  • 23. Inline CSS • Inside a tag the style property is added and css directives are added inside quotes • The format of the css is <property>:<value> • More than one css property can be separated by a semicolon • We have already seen an example of this; <div style="color:#0000FF"> <h3>This is a heading</h3> <p>This is a paragraph.</p> </div> • Text within the div will be displayed in blue
  • 24. CSS : Using an included File • It is a good idea to completely separate the css from the HTML by putting the css code in a separate file.
  • 25. web page Header HTML <HEAD> <TITLE>Computer Skills for Bioinformatics</TITLE> <LINK media=all href="https://dataman.bioinformatics.ic.ac.uk/computer skills/css/style.css" type=text/css rel-stylesheet> </HEAD>
  • 27. CSS : apply a style to an id In the css file you will have seen many items like this; #content {MARGIN-LEFT: 180px; WIDTH: 720px; MARGIN-RIGHT: 100px • This will apply the css to the section of the html with the id content <div id="content"> elements in here have css style content applied tothem </div>
  • 28. css apply a style to more than one element • The values of id attributes have to be unique by their natureIf you want to apply a style to more than one element then you can use the class attribute of a tag . • <div class="data-table"> ... </div> • <table class="data-table"> ... </table>
  • 29. css : apply style using class • These correspond to the .data-table directives at the bottom of the css file; • So whenever data-table is included as a class attribute the css rules are applied . • This can be applied to many elements on a page .
  • 30. Apply a CSS class to your form table <!doctype> <html> <head> <title>2019 Fourth Quarter Report</title> <link href="styles.css" rel="stylesheet" media="all" /> </head> <body> <table> </table> </body> </html>
  • 31. Working with multiple devices : Bootstrap Demonstration