SlideShare a Scribd company logo
Introduction to HTML
MIT - AITI
What is HTML?
ο‚΄ HTML, otherwise known as HyperText Markup
Language, is the language used to create Web pages
ο‚΄ Using HTML, you can create a Web page with text,
graphics, sound, and video
Tags
ο‚΄ The essence of HTML programming is tags
ο‚΄ A tag is a keyword enclosed by angle brackets
( Example: <I> )
ο‚΄ There are opening and closing tags for many but not
all tags; The affected text is between the two tags
More Tags...
ο‚΄ The opening and closing tags use the same command
except the closing tag contains and additional
forward slash /
ο‚΄ For example, the expression <B> Warning </B>
would cause the word β€˜Warning’ to appear in bold
face on a Web page
Nested Tags
ο‚΄ Whenever you have HTML tags within other HTML tags,
you must close the nearest tag first
ο‚΄ Example:
<H1> <I> The Nation </I> </H1>
Structure of a Web Page
ο‚΄All Web pages
share a
common
structure
ο‚΄All Web pages
should contain
a pair of
<HTML>,
<HEAD>, <TITLE>,
and <BODY>
tags
<HTML>
<HEAD>
<TITLE> Example </TITLE>
</HEAD>
<BODY>
This is where you would
include the text and
images on your Web
page.
</BODY>
</HTML>
The <TITLE> Tag
ο‚΄ Choose the title of your Web page carefully; The title
of a Web page determines its ranking in certain search
engines
ο‚΄ The title will also appear on Favorite lists, History lists,
and Bookmark lists to identify your page
Text Formatting
ο‚΄ Manipulating text in HTML can be tricky; Oftentimes,
what you see is NOT what you get
ο‚΄ For instance, special HTML tags are needed to create
paragraphs, move to the next line, and create
headings
Text Formatting Tags
<B> Bold Face </B>
<I> Italics </I>
<U> Underline </U>
<P> New Paragraph </P>
<BR> Next Line
Changing the Font
ο‚΄The expression <FONT FACE =
β€œfontname”> … </FONT> can be
used to change the font of the
enclosed text
ο‚΄ To change the size of text use the expression <FONT
SIZE=n> …. </FONT> where n is a number between 1
and 7
Changing the Font
ο‚΄ To change the color, use <FONT COLOR=β€œred”>…. </FONT>; The
color can also be defined using hexadecimal representation
( Example: #ffffff )
ο‚΄These attributes can be combined to
change the font, size, and color of the
text all at once; For example, <FONT
SIZE=4 FACE=β€œCourier” COLOR=β€œred”>
…. </FONT>
Headings
ο‚΄ Web pages are typically organized into sections with
headings; To create a heading use the expression
<Hn>….</Hn> where n is a number between 1 and 7
ο‚΄ In this case, the 1 corresponds to the largest size
heading while the 7 corresponds to the smallest size
Aligning Text
ο‚΄ The ALIGN attribute can be inserted in the <P> and
<Hn> tags to right justify, center, or left justify the text
ο‚΄ For example, <H1 ALIGN=CENTER> The New York Times
</H1> would create a centered heading of the largest
size
Comment Statements
ο‚΄ Comment statements are notes in the HTML code that
explain the important features of the code
ο‚΄ The comments do not appear on the Web page itself
but are a useful reference to the author of the page
and other programmers
ο‚΄ To create a comment statement use the <!-- …. -->
tags
The Infamous Blink Tag
ο‚΄ It is possible to make text blink using the <BLINK> …
</BLINK> tag
ο‚΄ However, it is best to use this feature at most sparingly
or not at all; What seems like a good idea to a Web
designer can become very annoying to a Web user
ο‚΄ The <BLINK> tag is not supported by Internet Explorer
Page Formatting
ο‚΄ To define the background color, use the BGCOLOR
attribute in the <BODY> tag
ο‚΄ To define the text color, use the TEXT attribute in the
<BODY> tag
ο‚΄ To define the size of the text, type <BASEFONT SIZE=n>
Example
<HTML>
<HEAD>
<TITLE> Example </TITLE>
</HEAD>
<BODY BGCOLOR=β€œblack” TEXT=β€œwhite”>
<BASEFONT SIZE=7>
This is where you would include the text and
images on your Web page.
</BODY>
</HTML>
Inserting Images
ο‚΄ Type <IMG SRC = β€œimage.ext”>, where image.ext
indicates the location of the image file
ο‚΄ The WIDTH=n and HEIGHT=n attributes can be used to
adjust the size of an image
ο‚΄ The attribute BORDER=n can be used to add a border
n pixels thick around the image
Alternate Text
ο‚΄ Some browsers don’t support images. In this case, the
ALT attribute can be used to create text that appears
instead of the image.
ο‚΄ Example:
<IMG SRC=β€œsatellite.jpg” ALT = β€œPicture of satellite”>
Links
ο‚΄ A link lets you move from one page to another, play
movies and sound, send email, download files, and
more….
ο‚΄ A link has three parts: a destination, a label, and a
target
ο‚΄ To create a link type
<A HREF=β€œpage.html”> label </A>
Anatomy of a Link
<A HREF=β€œpage.html”> label </A>
ο‚΄ In the above link, β€œpage.html” is the destination. The
destination specifies the address of the Web page or
file the user will access when he/she clicks on the link.
ο‚΄ The label is the text that will appear underlined or
highlighted on the page
Example: Links
ο‚΄ To create a link to CNN, I would type:
<A HREF=β€œhttp://www.cnn.com”>CNN</A>
ο‚΄ To create a link to MIT, I would type:
<A HREF=β€œhttp://www.mit.edu”>MIT</A>
Changing the Color of Links
ο‚΄ The LINK, VLINK, and ALINK attributes can be inserted
in the <BODY> tag to define the color of a link
ο‚΄ LINK defines the color of links that have not been visited
ο‚΄ VLINK defines the color of links that have already been
visited
ο‚΄ ALINK defines the color of a link when a user clicks on it
Using Links to Send Email
ο‚΄ To create a link to an email address, type <A
HREF=β€œmailto:email_address”> Label</A>
ο‚΄ For example, to create a link to send email to myself, I
would type: <A HREF=β€œmailto: ktdunn@mit.edu”>email
Katie Dunn</A>
Anchors
ο‚΄ Anchors enable a user to jump to a specific place on
a Web site
ο‚΄ Two steps are necessary to create an anchor. First you
must create the anchor itself. Then you must create a
link to the anchor from another point in the document.
Anchors
ο‚΄ To create the anchor itself, type <A NAME=β€œanchor
name”>label</A> at the point in the Web page where
you want the user to jump to
ο‚΄ To create the link, type <A HREF=β€œ#anchor
name”>label</A> at the point in the text where you
want the link to appear
Example: Anchor
<A HREF="#chap2">Chapter Two</A><BR>
<A NAME="chap2">Chapter 2 </A>
Link
Anch
or
Ordered Lists
ο‚΄ Ordered lists are a list
of numbered items.
ο‚΄ To create an ordered
list, type:
<OL>
<LI> This is step one.
<LI> This is step two.
<LI> This is step three.
</OL>
Here’s how it would
look on the Web:
More Ordered Lists….
ο‚΄ The TYPE=x attribute allows you to change the the kind
of symbol that appears in the list.
ο‚΄ A is for capital letters
ο‚΄ a is for lowercase letters
ο‚΄ I is for capital roman numerals
ο‚΄ i is for lowercase roman numerals
Unordered Lists
ο‚΄ An unordered list is a
list of bulleted items
ο‚΄ To create an
unordered list, type:
<UL>
<LI> First item in list
<LI> Second item in
list
<LI> Third item in list
</UL>
Here’s how it would
look on the Web:
More Unordered Lists...
ο‚΄ The TYPE=shape attribute allows you to change the
type of bullet that appears
ο‚΄ circle corresponds to an empty round bullet
ο‚΄ square corresponds to a square bullet
ο‚΄ disc corresponds to a solid round bullet; this is the default
value
Forms
ο‚§ What are forms?
β€’ An HTML form is an area of the document that allows users to enter
information into fields.
β€’ A form may be used to collect personal information, opinions in polls,
user preferences and other kinds of information.
Forms
ο‚΄ There are two basic components of a Web form: the
shell, the part that the user fills out, and the script
which processes the information
ο‚΄ HTML tags are used to create the form shell. Using
HTML you can create text boxes, radio buttons,
checkboxes, drop-down menus, and more...
Example: Form
Text Box
Drop-down Menu
Radio Buttons
Checkboxes
Text Area
Submit Button
Reset Button
The Form Shell
ο‚΄ A form shell has three important parts:
ο‚΄ the <FORM> tag, which includes the address of the script
which will process the form
ο‚΄ the form elements, like text boxes and radio buttons
ο‚΄ the submit button which triggers the script to send the
entered information to the server
Creating the Shell
ο‚΄ To create a form shell, type <FORM METHOD=POST
ACTION=β€œscript_url”> where β€œscript_url” is the address
of the script
ο‚΄ Create the form elements
ο‚΄ End with a closing </FORM> tag
Creating Text Boxes
ο‚΄ To create a text box, type <INPUT TYPE=β€œtext”
NAME=β€œname” VALUE=β€œvalue” SIZE=n MAXLENGTH=n>
ο‚΄ The NAME, VALUE, SIZE, and MAXLENGTH attributes are
optional
Text Box Attributes
ο‚΄ The NAME attribute is used to identify the text box to the
processing script
ο‚΄ The VALUE attribute is used to specify the text that will initially
appear in the text box
ο‚΄ The SIZE attribute is used to define the size of the box in
characters
ο‚΄ The MAXLENGTH attribute is used to define the maximum number
of characters that can be typed in the box
Example: Text Box
First Name: <INPUT
TYPE="text"
NAME="FirstName"
VALUE="First Name"
SIZE=20>
<BR><BR>
Last Name: <INPUT
TYPE="text"
NAME="LastName"
VALUE="Last Name"
SIZE=20>
<BR><BR>
ο‚΄ Here’s how it
would look on
the Web:
Creating Larger Text Areas
ο‚΄ To create larger text areas, type <TEXTAREA
NAME=β€œname” ROWS=n1 COLS=n2 WRAP> Default
Text </TEXTAREA>, where n1 is the height of the text
box in rows and n2 is the width of the text box in
characters
ο‚΄ The WRAP attribute causes the cursor to move
automatically to the next line as the user types
Example: Text Area
<B>Comments?</B>
<BR>
<TEXTAREA NAME="Comments"
ROWS=10 COLS=50 WRAP>
</TEXTAREA>
Creating Radio Buttons
ο‚΄ To create a radio button, type <INPUT TYPE=β€œradio”
NAME=β€œname” VALUE=β€œdata”>Label, where β€œdata” is
the text that will be sent to the server if the button is
checked and β€œLabel” is the text that identifies the
button to the user
Example: Radio Buttons
<B> Size: </B>
<INPUT TYPE="radio" NAME="Size"
VALUE="Large">Large
<INPUT TYPE="radio" NAME="Size"
VALUE="Medium">Medium
<INPUT TYPE="radio" NAME="Size"
VALUE="Small">Small
Creating Checkboxes
ο‚΄ To create a checkbox, type <INPUT TYPE=β€œcheckbox”
NAME=β€œname” VALUE=β€œvalue”>Label
ο‚΄ If you give a group of radio buttons or checkboxes the
same name, the user will only be able to select one
button or box at a time
Example: Checkboxes
<B> Color: </B>
<INPUT TYPE="checkbox"
NAME="Color" VALUE="Red">Red
<INPUT TYPE="checkbox"
NAME="Color"
VALUE="Navy">Navy
<INPUT TYPE="checkbox"
NAME="Color"
VALUE="Black">Black
Creating Drop-down Menus
ο‚΄ To create a drop-down menu, type <SELECT
NAME=β€œname” SIZE=n MULTIPLE>
ο‚΄ Then type <OPTION VALUE= β€œvalue”>Label
ο‚΄ In this case the SIZE attribute specifies the height of the
menu in lines and MULTIPLE allows users to select more
than one menu option
Example: Drop-down Menu
<B>WHICH IS FAVOURITE FRUIT:</B>
<SELECT>
<OPTION VALUE="MANGOES">MANGOES
<OPTION VALUE="PAPAYA">PAPAYA
<OPTION VALUE="GUAVA">GUAVA
<OPTION VALUE="BANANA"> BANANA
<OPTION VALUE="PINEAPPLE">PINEAPPLE
</SELECT>
Creating a Submit Button
ο‚΄ To create a submit button, type <INPUT
TYPE=β€œsubmit”>
ο‚΄ If you would like the button to say something other
than submit, use the VALUE attribute
ο‚΄ For example, <INPUT TYPE=β€œsubmit” VALUE=β€œBuy
Now!”> would create a button that says β€œBuy Now!”
Creating a Reset Button
ο‚΄ To create a reset button, type <INPUT TYPE=β€œreset”>
ο‚΄ The VALUE attribute can be used in the same way to
change the text that appears on the button
Tables
ο‚΄ Tables can be used to display rows and columns of
data, create multi-column text, captions for images,
and sidebars
ο‚΄ The <TABLE> tag is used to create a table; the <TR>
tag defines the beginning of a row while the <TD> tag
defines the beginning of a cell
Adding a Border
ο‚΄ The BORDER=n attribute allows you to add a border n
pixels thick around the table
ο‚΄ To make a solid border color, use the
BORDERCOLOR=β€œcolor” attribute
ο‚΄ To make a shaded colored border, use
BODERCOLORDARK=β€œcolor” and
BORDERCOLORLIGHT=β€œcolor”
Creating Simple Table
<TABLE BORDER=10>
<TR>
<TD>One</TD>
<TD>Two</TD>
</TR>
<TR>
<TD>Three</TD>
<TD>Four</TD>
</TR>
</TABLE>
ο‚΄ Here’s how it
would look on
the Web:
Adjusting the Width
ο‚΄ When a Web browser displays a table, it often adds
extra space. To eliminate this space use the WIDTH =n
attribute in the <TABLE> and <TD> tags
ο‚΄ Keep in mind - a cell cannot be smaller than its
contents, and if you make a table wider than the
browser window, users will not be able to see parts of
it.
Centering a Table
ο‚΄ There are two ways to center a table
ο‚΄ Type <TABLE ALIGN=CENTER>
ο‚΄ Enclose the <TABLE> tags in opening and closing
<CENTER> tags
Wrapping Text around a
Table
ο‚΄ It is possible to wrap text around a table.
This technique is often used to keep
images and captions together within an
article.
ο‚΄ To wrap text around a table, type
<TABLE ALIGN = LEFT> to align the table
to the left while the text flows to the right.
ο‚΄ Create the table using the <TR>, <TD>,
and </TABLE> tags as you normally
would
Adding Space around a
Table
ο‚΄ To add space around a table, use the HSPACE=n and
VSPACE=n attributes in the <TABLE> tag
ο‚΄ Example:
<TABLE HSPACE=20 VSPACE=20>
Spanning Cells Across
Columns
ο‚΄ It is often necessary to span one cell across many
columns. For example, you would use this technique to
span a headline across the columns of a newspaper
article.
ο‚΄ To span a cell across many columns, type <TD
COLSPAN=n>, where n is the number of columns to be
spanned
Spanning Cells Across Rows
ο‚΄ To span a cell across many rows, type <TD
ROWSPAN=n>, where n is the number of rows
Aligning Cell Content
ο‚΄ By default, a cell’s content are aligned horizontally to
the left and and vertically in the middle.
ο‚΄ Use VALIGN=direction to change the vertical
alignment, where β€œdirection” is top, middle, bottom, or
baseline
ο‚΄ Use ALIGN=direction to change the horizontal
alignment where β€œdirection” is left, center, or right
Controlling Cell Spacing
ο‚΄ Cell spacing is the space between cells while cell
padding is the space around the contents of a cell
ο‚΄ To control both types of spacing, use the
CELLSPACING =n and CELLPADDING=n attributes in
the <TABLE> tag
Nesting Tables
ο‚΄ Create the inner table
ο‚΄ Create the outer table and determine which
cell of the outer table will hold the inner
table
ο‚΄ Test both tables separately to make sure
they work
ο‚΄ Copy the inner table into the cell of the
outer table
ο‚΄ Don’t nest too many tables. If you find
yourself doing that, find an easier way to lay
out your Web page
Changing a Cell’s Color
ο‚΄ To change a cell’s color, add the BGCOLOR=β€œcolor”
attribute to the <TD> tag
ο‚΄ Example:
<TD BGCOLOR=β€œblue”>
Dividing Your Table into
Column Groups
ο‚΄ You can divide your table into two kinds of column
groups: structural and non-structural.
ο‚΄ Structural column groups control where dividing lines
are drawn; Non-structural groups do not
ο‚΄ Both let you format an entire column of cells at once
Column Groups
ο‚΄To create structural column
groups, type <COLGROUP
SPAN=n> after the <TABLE> tag,
where n is the number of columns
in the group
ο‚΄To create non-structural column
groups, type <COL SPAN=n>,
where n is the number of columns
in the group
Dividing Table into Horizontal
Sections
ο‚΄ You can also create a horizontal section consisting of
one or more rows. This allows you to format the rows all
at once
ο‚΄ To create a horizontal section, type <THEAD>,
<TBODY>, or <TFOOT> before the first <TR> tag of the
section
ο‚΄ Netscape does not support these tags
Controlling Line Breaks
ο‚΄ Unless you specify otherwise a browser will divide the
lines in a cell as it sees fit.
ο‚΄ The NOWRAP attribute placed within the <TD> tag
forces the browser to keep all the text in a cell on one
line
ο‚΄ Example:
ο‚΄ <TD NOWRAP>Washington, D.C.
Parting Words….
ο‚΄ If you can imagine a way to lay out your page,
chances are it is possible using HTML
ο‚΄ When in doubt, use an HTML reference

More Related Content

PPT
IntroHTML.ppt
PPT
IntroHTML.ppt
PPT
HTML.ppt
PPT
IntroHTML.ppt
PPT
IntroHTML.ppt
PPT
HTML.ppt
PPT
Intro html
PPT
Intro html
IntroHTML.ppt
IntroHTML.ppt
HTML.ppt
IntroHTML.ppt
IntroHTML.ppt
HTML.ppt
Intro html
Intro html

Similar to introduction to html and cssIntroHTML.ppt (20)

PPT
Lecture-02 Introduction to HTML .pptx.ppt
PPT
Lecture-02 Introduction to HTML .pptx.ppt
PDF
Lecture17.pdf
PDF
Lecture17.pdf
PPTX
Part 1 -HTML- Basic_Spring 2023.pptx
PPTX
Part 1 -HTML- Basic_Spring 2023.pptx
PDF
Introduction to HTML programming for webpages.pdf
PDF
Introduction to HTML programming for webpages.pdf
PPTX
Episode 14 - Basics of HTML for Salesforce
PPTX
Episode 14 - Basics of HTML for Salesforce
PPT
Introduction to HTML
PPT
Introduction to HTML
PPTX
Html basics
PPTX
Html basics
PPT
Introduction html
PPT
Introduction html
PPT
IntroHTMzczczscasasaklahduasihiaSUJScgGJKKL.ppt
PPT
IntroHTMzczczscasasaklahduasihiaSUJScgGJKKL.ppt
Lecture-02 Introduction to HTML .pptx.ppt
Lecture-02 Introduction to HTML .pptx.ppt
Lecture17.pdf
Lecture17.pdf
Part 1 -HTML- Basic_Spring 2023.pptx
Part 1 -HTML- Basic_Spring 2023.pptx
Introduction to HTML programming for webpages.pdf
Introduction to HTML programming for webpages.pdf
Episode 14 - Basics of HTML for Salesforce
Episode 14 - Basics of HTML for Salesforce
Introduction to HTML
Introduction to HTML
Html basics
Html basics
Introduction html
Introduction html
IntroHTMzczczscasasaklahduasihiaSUJScgGJKKL.ppt
IntroHTMzczczscasasaklahduasihiaSUJScgGJKKL.ppt
Ad

More from SherifElGohary7 (20)

PPT
introduction to html and css html1.ppt
PPT
2-Test biocompatibilitalty testing .ppt
PPTX
articulating mirrors laser application 1610922286.pptx
PPTX
Intrusion Detection and Prevention Systems.pptx
PPTX
AAMI medical device standards program.pptx
PPT
dppc-breach-notification-slides-201804.ppt
PPTX
presentationsPPT-HIPAA-Privacy-Rule-Training.pptx
PPT
Lectureof nano 1588236675-biosensors (1).ppt
PPT
Lecture digital logic design Chapter4_4Web.ppt
PPT
Encoder-Decoder-Multiplexers-and-Demultiplexers.ppt
PPT
Lecture of BloodGlucoseMonitoring2008.ppt
PDF
IT GovernanceChallenges facing IT Governance.pdf
PPT
Chapter 12 CSR and Corporate Governance.ppt
PDF
Digital logic design of 2nd Lecture 2.pdf
PDF
Medical biophysics of Introduction-18.pdf
PPT
Digital-logic-design-16148_flip-flop1.ppt
PPT
Lecture-digital-27_T_and_JK_Flip-Flops.ppt
PPT
Lecture-digital logic design-32_Counters.ppt
PPT
Lecture-Logic Design_circuit-15-Registers.ppt
PPT
lecture_binary_logic_and_logic_gates.ppt
introduction to html and css html1.ppt
2-Test biocompatibilitalty testing .ppt
articulating mirrors laser application 1610922286.pptx
Intrusion Detection and Prevention Systems.pptx
AAMI medical device standards program.pptx
dppc-breach-notification-slides-201804.ppt
presentationsPPT-HIPAA-Privacy-Rule-Training.pptx
Lectureof nano 1588236675-biosensors (1).ppt
Lecture digital logic design Chapter4_4Web.ppt
Encoder-Decoder-Multiplexers-and-Demultiplexers.ppt
Lecture of BloodGlucoseMonitoring2008.ppt
IT GovernanceChallenges facing IT Governance.pdf
Chapter 12 CSR and Corporate Governance.ppt
Digital logic design of 2nd Lecture 2.pdf
Medical biophysics of Introduction-18.pdf
Digital-logic-design-16148_flip-flop1.ppt
Lecture-digital-27_T_and_JK_Flip-Flops.ppt
Lecture-digital logic design-32_Counters.ppt
Lecture-Logic Design_circuit-15-Registers.ppt
lecture_binary_logic_and_logic_gates.ppt
Ad

Recently uploaded (20)

PPTX
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
PDF
Centralized Business Email Management_ How Admin Controls Boost Efficiency & ...
PPTX
Introduction to Information and Communication Technology
PPTX
CSharp_Syntax_Basics.pptxxxxxxxxxxxxxxxxxxxxxxxxxxxx
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PPTX
PPT_M4.3_WORKING WITH SLIDES APPLIED.pptx
PDF
Behind the Smile Unmasking Ken Childs and the Quiet Trail of Deceit Left in H...
DOCX
Unit-3 cyber security network security of internet system
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
Β 
PDF
Slides PDF The World Game (s) Eco Economic Epochs.pdf
PDF
πŸ’° π”πŠπ“πˆ πŠπ„πŒπ„ππ€ππ†π€π πŠπˆππ„π‘πŸ’πƒ π‡π€π‘πˆ 𝐈𝐍𝐈 πŸπŸŽπŸπŸ“ πŸ’°
Β 
PPTX
Slides PPTX World Game (s) Eco Economic Epochs.pptx
PDF
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PDF
Sims 4 Historia para lo sims 4 para jugar
PDF
Paper PDF World Game (s) Great Redesign.pdf
PDF
LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1
PDF
The Internet -By the Numbers, Sri Lanka Edition
Β 
CHE NAA, , b,mn,mblblblbljb jb jlb ,j , ,C PPT.pptx
Centralized Business Email Management_ How Admin Controls Boost Efficiency & ...
Introduction to Information and Communication Technology
CSharp_Syntax_Basics.pptxxxxxxxxxxxxxxxxxxxxxxxxxxxx
WebRTC in SignalWire - troubleshooting media negotiation
PPT_M4.3_WORKING WITH SLIDES APPLIED.pptx
Behind the Smile Unmasking Ken Childs and the Quiet Trail of Deceit Left in H...
Unit-3 cyber security network security of internet system
522797556-Unit-2-Temperature-measurement-1-1.pptx
Tenda Login Guide: Access Your Router in 5 Easy Steps
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
Β 
Slides PDF The World Game (s) Eco Economic Epochs.pdf
πŸ’° π”πŠπ“πˆ πŠπ„πŒπ„ππ€ππ†π€π πŠπˆππ„π‘πŸ’πƒ π‡π€π‘πˆ 𝐈𝐍𝐈 πŸπŸŽπŸπŸ“ πŸ’°
Β 
Slides PPTX World Game (s) Eco Economic Epochs.pptx
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
Job_Card_System_Styled_lorem_ipsum_.pptx
Sims 4 Historia para lo sims 4 para jugar
Paper PDF World Game (s) Great Redesign.pdf
LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1
The Internet -By the Numbers, Sri Lanka Edition
Β 

introduction to html and cssIntroHTML.ppt

  • 2. What is HTML? ο‚΄ HTML, otherwise known as HyperText Markup Language, is the language used to create Web pages ο‚΄ Using HTML, you can create a Web page with text, graphics, sound, and video
  • 3. Tags ο‚΄ The essence of HTML programming is tags ο‚΄ A tag is a keyword enclosed by angle brackets ( Example: <I> ) ο‚΄ There are opening and closing tags for many but not all tags; The affected text is between the two tags
  • 4. More Tags... ο‚΄ The opening and closing tags use the same command except the closing tag contains and additional forward slash / ο‚΄ For example, the expression <B> Warning </B> would cause the word β€˜Warning’ to appear in bold face on a Web page
  • 5. Nested Tags ο‚΄ Whenever you have HTML tags within other HTML tags, you must close the nearest tag first ο‚΄ Example: <H1> <I> The Nation </I> </H1>
  • 6. Structure of a Web Page ο‚΄All Web pages share a common structure ο‚΄All Web pages should contain a pair of <HTML>, <HEAD>, <TITLE>, and <BODY> tags <HTML> <HEAD> <TITLE> Example </TITLE> </HEAD> <BODY> This is where you would include the text and images on your Web page. </BODY> </HTML>
  • 7. The <TITLE> Tag ο‚΄ Choose the title of your Web page carefully; The title of a Web page determines its ranking in certain search engines ο‚΄ The title will also appear on Favorite lists, History lists, and Bookmark lists to identify your page
  • 8. Text Formatting ο‚΄ Manipulating text in HTML can be tricky; Oftentimes, what you see is NOT what you get ο‚΄ For instance, special HTML tags are needed to create paragraphs, move to the next line, and create headings
  • 9. Text Formatting Tags <B> Bold Face </B> <I> Italics </I> <U> Underline </U> <P> New Paragraph </P> <BR> Next Line
  • 10. Changing the Font ο‚΄The expression <FONT FACE = β€œfontname”> … </FONT> can be used to change the font of the enclosed text ο‚΄ To change the size of text use the expression <FONT SIZE=n> …. </FONT> where n is a number between 1 and 7
  • 11. Changing the Font ο‚΄ To change the color, use <FONT COLOR=β€œred”>…. </FONT>; The color can also be defined using hexadecimal representation ( Example: #ffffff ) ο‚΄These attributes can be combined to change the font, size, and color of the text all at once; For example, <FONT SIZE=4 FACE=β€œCourier” COLOR=β€œred”> …. </FONT>
  • 12. Headings ο‚΄ Web pages are typically organized into sections with headings; To create a heading use the expression <Hn>….</Hn> where n is a number between 1 and 7 ο‚΄ In this case, the 1 corresponds to the largest size heading while the 7 corresponds to the smallest size
  • 13. Aligning Text ο‚΄ The ALIGN attribute can be inserted in the <P> and <Hn> tags to right justify, center, or left justify the text ο‚΄ For example, <H1 ALIGN=CENTER> The New York Times </H1> would create a centered heading of the largest size
  • 14. Comment Statements ο‚΄ Comment statements are notes in the HTML code that explain the important features of the code ο‚΄ The comments do not appear on the Web page itself but are a useful reference to the author of the page and other programmers ο‚΄ To create a comment statement use the <!-- …. --> tags
  • 15. The Infamous Blink Tag ο‚΄ It is possible to make text blink using the <BLINK> … </BLINK> tag ο‚΄ However, it is best to use this feature at most sparingly or not at all; What seems like a good idea to a Web designer can become very annoying to a Web user ο‚΄ The <BLINK> tag is not supported by Internet Explorer
  • 16. Page Formatting ο‚΄ To define the background color, use the BGCOLOR attribute in the <BODY> tag ο‚΄ To define the text color, use the TEXT attribute in the <BODY> tag ο‚΄ To define the size of the text, type <BASEFONT SIZE=n>
  • 17. Example <HTML> <HEAD> <TITLE> Example </TITLE> </HEAD> <BODY BGCOLOR=β€œblack” TEXT=β€œwhite”> <BASEFONT SIZE=7> This is where you would include the text and images on your Web page. </BODY> </HTML>
  • 18. Inserting Images ο‚΄ Type <IMG SRC = β€œimage.ext”>, where image.ext indicates the location of the image file ο‚΄ The WIDTH=n and HEIGHT=n attributes can be used to adjust the size of an image ο‚΄ The attribute BORDER=n can be used to add a border n pixels thick around the image
  • 19. Alternate Text ο‚΄ Some browsers don’t support images. In this case, the ALT attribute can be used to create text that appears instead of the image. ο‚΄ Example: <IMG SRC=β€œsatellite.jpg” ALT = β€œPicture of satellite”>
  • 20. Links ο‚΄ A link lets you move from one page to another, play movies and sound, send email, download files, and more…. ο‚΄ A link has three parts: a destination, a label, and a target ο‚΄ To create a link type <A HREF=β€œpage.html”> label </A>
  • 21. Anatomy of a Link <A HREF=β€œpage.html”> label </A> ο‚΄ In the above link, β€œpage.html” is the destination. The destination specifies the address of the Web page or file the user will access when he/she clicks on the link. ο‚΄ The label is the text that will appear underlined or highlighted on the page
  • 22. Example: Links ο‚΄ To create a link to CNN, I would type: <A HREF=β€œhttp://www.cnn.com”>CNN</A> ο‚΄ To create a link to MIT, I would type: <A HREF=β€œhttp://www.mit.edu”>MIT</A>
  • 23. Changing the Color of Links ο‚΄ The LINK, VLINK, and ALINK attributes can be inserted in the <BODY> tag to define the color of a link ο‚΄ LINK defines the color of links that have not been visited ο‚΄ VLINK defines the color of links that have already been visited ο‚΄ ALINK defines the color of a link when a user clicks on it
  • 24. Using Links to Send Email ο‚΄ To create a link to an email address, type <A HREF=β€œmailto:email_address”> Label</A> ο‚΄ For example, to create a link to send email to myself, I would type: <A HREF=β€œmailto: [email protected]”>email Katie Dunn</A>
  • 25. Anchors ο‚΄ Anchors enable a user to jump to a specific place on a Web site ο‚΄ Two steps are necessary to create an anchor. First you must create the anchor itself. Then you must create a link to the anchor from another point in the document.
  • 26. Anchors ο‚΄ To create the anchor itself, type <A NAME=β€œanchor name”>label</A> at the point in the Web page where you want the user to jump to ο‚΄ To create the link, type <A HREF=β€œ#anchor name”>label</A> at the point in the text where you want the link to appear
  • 27. Example: Anchor <A HREF="#chap2">Chapter Two</A><BR> <A NAME="chap2">Chapter 2 </A> Link Anch or
  • 28. Ordered Lists ο‚΄ Ordered lists are a list of numbered items. ο‚΄ To create an ordered list, type: <OL> <LI> This is step one. <LI> This is step two. <LI> This is step three. </OL> Here’s how it would look on the Web:
  • 29. More Ordered Lists…. ο‚΄ The TYPE=x attribute allows you to change the the kind of symbol that appears in the list. ο‚΄ A is for capital letters ο‚΄ a is for lowercase letters ο‚΄ I is for capital roman numerals ο‚΄ i is for lowercase roman numerals
  • 30. Unordered Lists ο‚΄ An unordered list is a list of bulleted items ο‚΄ To create an unordered list, type: <UL> <LI> First item in list <LI> Second item in list <LI> Third item in list </UL> Here’s how it would look on the Web:
  • 31. More Unordered Lists... ο‚΄ The TYPE=shape attribute allows you to change the type of bullet that appears ο‚΄ circle corresponds to an empty round bullet ο‚΄ square corresponds to a square bullet ο‚΄ disc corresponds to a solid round bullet; this is the default value
  • 32. Forms ο‚§ What are forms? β€’ An HTML form is an area of the document that allows users to enter information into fields. β€’ A form may be used to collect personal information, opinions in polls, user preferences and other kinds of information.
  • 33. Forms ο‚΄ There are two basic components of a Web form: the shell, the part that the user fills out, and the script which processes the information ο‚΄ HTML tags are used to create the form shell. Using HTML you can create text boxes, radio buttons, checkboxes, drop-down menus, and more...
  • 34. Example: Form Text Box Drop-down Menu Radio Buttons Checkboxes Text Area Submit Button Reset Button
  • 35. The Form Shell ο‚΄ A form shell has three important parts: ο‚΄ the <FORM> tag, which includes the address of the script which will process the form ο‚΄ the form elements, like text boxes and radio buttons ο‚΄ the submit button which triggers the script to send the entered information to the server
  • 36. Creating the Shell ο‚΄ To create a form shell, type <FORM METHOD=POST ACTION=β€œscript_url”> where β€œscript_url” is the address of the script ο‚΄ Create the form elements ο‚΄ End with a closing </FORM> tag
  • 37. Creating Text Boxes ο‚΄ To create a text box, type <INPUT TYPE=β€œtext” NAME=β€œname” VALUE=β€œvalue” SIZE=n MAXLENGTH=n> ο‚΄ The NAME, VALUE, SIZE, and MAXLENGTH attributes are optional
  • 38. Text Box Attributes ο‚΄ The NAME attribute is used to identify the text box to the processing script ο‚΄ The VALUE attribute is used to specify the text that will initially appear in the text box ο‚΄ The SIZE attribute is used to define the size of the box in characters ο‚΄ The MAXLENGTH attribute is used to define the maximum number of characters that can be typed in the box
  • 39. Example: Text Box First Name: <INPUT TYPE="text" NAME="FirstName" VALUE="First Name" SIZE=20> <BR><BR> Last Name: <INPUT TYPE="text" NAME="LastName" VALUE="Last Name" SIZE=20> <BR><BR> ο‚΄ Here’s how it would look on the Web:
  • 40. Creating Larger Text Areas ο‚΄ To create larger text areas, type <TEXTAREA NAME=β€œname” ROWS=n1 COLS=n2 WRAP> Default Text </TEXTAREA>, where n1 is the height of the text box in rows and n2 is the width of the text box in characters ο‚΄ The WRAP attribute causes the cursor to move automatically to the next line as the user types
  • 41. Example: Text Area <B>Comments?</B> <BR> <TEXTAREA NAME="Comments" ROWS=10 COLS=50 WRAP> </TEXTAREA>
  • 42. Creating Radio Buttons ο‚΄ To create a radio button, type <INPUT TYPE=β€œradio” NAME=β€œname” VALUE=β€œdata”>Label, where β€œdata” is the text that will be sent to the server if the button is checked and β€œLabel” is the text that identifies the button to the user
  • 43. Example: Radio Buttons <B> Size: </B> <INPUT TYPE="radio" NAME="Size" VALUE="Large">Large <INPUT TYPE="radio" NAME="Size" VALUE="Medium">Medium <INPUT TYPE="radio" NAME="Size" VALUE="Small">Small
  • 44. Creating Checkboxes ο‚΄ To create a checkbox, type <INPUT TYPE=β€œcheckbox” NAME=β€œname” VALUE=β€œvalue”>Label ο‚΄ If you give a group of radio buttons or checkboxes the same name, the user will only be able to select one button or box at a time
  • 45. Example: Checkboxes <B> Color: </B> <INPUT TYPE="checkbox" NAME="Color" VALUE="Red">Red <INPUT TYPE="checkbox" NAME="Color" VALUE="Navy">Navy <INPUT TYPE="checkbox" NAME="Color" VALUE="Black">Black
  • 46. Creating Drop-down Menus ο‚΄ To create a drop-down menu, type <SELECT NAME=β€œname” SIZE=n MULTIPLE> ο‚΄ Then type <OPTION VALUE= β€œvalue”>Label ο‚΄ In this case the SIZE attribute specifies the height of the menu in lines and MULTIPLE allows users to select more than one menu option
  • 47. Example: Drop-down Menu <B>WHICH IS FAVOURITE FRUIT:</B> <SELECT> <OPTION VALUE="MANGOES">MANGOES <OPTION VALUE="PAPAYA">PAPAYA <OPTION VALUE="GUAVA">GUAVA <OPTION VALUE="BANANA"> BANANA <OPTION VALUE="PINEAPPLE">PINEAPPLE </SELECT>
  • 48. Creating a Submit Button ο‚΄ To create a submit button, type <INPUT TYPE=β€œsubmit”> ο‚΄ If you would like the button to say something other than submit, use the VALUE attribute ο‚΄ For example, <INPUT TYPE=β€œsubmit” VALUE=β€œBuy Now!”> would create a button that says β€œBuy Now!”
  • 49. Creating a Reset Button ο‚΄ To create a reset button, type <INPUT TYPE=β€œreset”> ο‚΄ The VALUE attribute can be used in the same way to change the text that appears on the button
  • 50. Tables ο‚΄ Tables can be used to display rows and columns of data, create multi-column text, captions for images, and sidebars ο‚΄ The <TABLE> tag is used to create a table; the <TR> tag defines the beginning of a row while the <TD> tag defines the beginning of a cell
  • 51. Adding a Border ο‚΄ The BORDER=n attribute allows you to add a border n pixels thick around the table ο‚΄ To make a solid border color, use the BORDERCOLOR=β€œcolor” attribute ο‚΄ To make a shaded colored border, use BODERCOLORDARK=β€œcolor” and BORDERCOLORLIGHT=β€œcolor”
  • 52. Creating Simple Table <TABLE BORDER=10> <TR> <TD>One</TD> <TD>Two</TD> </TR> <TR> <TD>Three</TD> <TD>Four</TD> </TR> </TABLE> ο‚΄ Here’s how it would look on the Web:
  • 53. Adjusting the Width ο‚΄ When a Web browser displays a table, it often adds extra space. To eliminate this space use the WIDTH =n attribute in the <TABLE> and <TD> tags ο‚΄ Keep in mind - a cell cannot be smaller than its contents, and if you make a table wider than the browser window, users will not be able to see parts of it.
  • 54. Centering a Table ο‚΄ There are two ways to center a table ο‚΄ Type <TABLE ALIGN=CENTER> ο‚΄ Enclose the <TABLE> tags in opening and closing <CENTER> tags
  • 55. Wrapping Text around a Table ο‚΄ It is possible to wrap text around a table. This technique is often used to keep images and captions together within an article. ο‚΄ To wrap text around a table, type <TABLE ALIGN = LEFT> to align the table to the left while the text flows to the right. ο‚΄ Create the table using the <TR>, <TD>, and </TABLE> tags as you normally would
  • 56. Adding Space around a Table ο‚΄ To add space around a table, use the HSPACE=n and VSPACE=n attributes in the <TABLE> tag ο‚΄ Example: <TABLE HSPACE=20 VSPACE=20>
  • 57. Spanning Cells Across Columns ο‚΄ It is often necessary to span one cell across many columns. For example, you would use this technique to span a headline across the columns of a newspaper article. ο‚΄ To span a cell across many columns, type <TD COLSPAN=n>, where n is the number of columns to be spanned
  • 58. Spanning Cells Across Rows ο‚΄ To span a cell across many rows, type <TD ROWSPAN=n>, where n is the number of rows
  • 59. Aligning Cell Content ο‚΄ By default, a cell’s content are aligned horizontally to the left and and vertically in the middle. ο‚΄ Use VALIGN=direction to change the vertical alignment, where β€œdirection” is top, middle, bottom, or baseline ο‚΄ Use ALIGN=direction to change the horizontal alignment where β€œdirection” is left, center, or right
  • 60. Controlling Cell Spacing ο‚΄ Cell spacing is the space between cells while cell padding is the space around the contents of a cell ο‚΄ To control both types of spacing, use the CELLSPACING =n and CELLPADDING=n attributes in the <TABLE> tag
  • 61. Nesting Tables ο‚΄ Create the inner table ο‚΄ Create the outer table and determine which cell of the outer table will hold the inner table ο‚΄ Test both tables separately to make sure they work ο‚΄ Copy the inner table into the cell of the outer table ο‚΄ Don’t nest too many tables. If you find yourself doing that, find an easier way to lay out your Web page
  • 62. Changing a Cell’s Color ο‚΄ To change a cell’s color, add the BGCOLOR=β€œcolor” attribute to the <TD> tag ο‚΄ Example: <TD BGCOLOR=β€œblue”>
  • 63. Dividing Your Table into Column Groups ο‚΄ You can divide your table into two kinds of column groups: structural and non-structural. ο‚΄ Structural column groups control where dividing lines are drawn; Non-structural groups do not ο‚΄ Both let you format an entire column of cells at once
  • 64. Column Groups ο‚΄To create structural column groups, type <COLGROUP SPAN=n> after the <TABLE> tag, where n is the number of columns in the group ο‚΄To create non-structural column groups, type <COL SPAN=n>, where n is the number of columns in the group
  • 65. Dividing Table into Horizontal Sections ο‚΄ You can also create a horizontal section consisting of one or more rows. This allows you to format the rows all at once ο‚΄ To create a horizontal section, type <THEAD>, <TBODY>, or <TFOOT> before the first <TR> tag of the section ο‚΄ Netscape does not support these tags
  • 66. Controlling Line Breaks ο‚΄ Unless you specify otherwise a browser will divide the lines in a cell as it sees fit. ο‚΄ The NOWRAP attribute placed within the <TD> tag forces the browser to keep all the text in a cell on one line ο‚΄ Example: ο‚΄ <TD NOWRAP>Washington, D.C.
  • 67. Parting Words…. ο‚΄ If you can imagine a way to lay out your page, chances are it is possible using HTML ο‚΄ When in doubt, use an HTML reference