SlideShare a Scribd company logo
1
HTML/CSS Tutorial
2
Definitions
 WWW -- a software infrastructure layered on top of
the Internet
 HTTP -- HyperText Transport Protocol, layered on
top of TCP
 HTTPS -- secure HTTP using encryption
 HTML -- HyperText Markup Language, version
4.01 is current
3
HTML Page Format
<HTML>
<HEAD>
<TITLE> Qi’s web! </TITLE>
</HEAD>
<BODY>
<H1> Hello World </H1>
<! Rest of page goes here. This is a comment. >
</BODY>
</HTML>
4
BODY Element
<BODY attributename="attributevalue">
 Deprecated attributes (but still used)
 BACKGROUND=“Sunset.jpg” (can be tiled)
 BGCOLOR=color
 TEXT=color
 LINK=color (unvisited links)
 VLINK=color (visited links)
 ALINK=color (when selected)
5
Headings
<H1 ...> text </H1> -- largest of the six
<H2 ...> text </H2>
<H3 ...> text </H3>
<H4 ...> text </H4>
<H5 ...> text </H5>
<H6 ...> text </H6> -- smallest of the six
ALIGN="position" --left (default), center or right
6
Headings
<HTML>
<HEAD>
<TITLE>Document Headings</TITLE>
</HEAD>
<BODY>
Samples of the six heading types:
<H1>Level-1 (H1)</H1>
<H2 ALIGN="center">Level-2 (H2)</H2>
<H3><U>Level-3 (H3)</U></H3>
<H4 ALIGN="right">Level-4 (H4)</H4>
<H5>Level-5 (H5)</H5>
<H6>Level-6 (H6)</H6>
</BODY>
</HTML>
7
<P> Paragraph
 <P> defines a paragraph
 Add ALIGN="position" (left, center, right)
 Multiple <P>'s do not create blank lines
 Use <BR> for blank line
 Fully-specified text uses <P> and </P>
 But </P> is optional
8
<BODY>
<P>Here is some text </P>
<P ALIGN="center"> Centered text </P>
<P><P><P>
<P ALIGN="right"> Right-justified text
<! Note: no closing /P tag is not a problem>
</BODY>
9
<PRE> Preformatted Text
<PRE>
if (a < b) {
a++;
b = c * d;
}
else {
a--;
b = (b-1)/2;
}
</PRE>
10
Special Characters
Character Use
< &lt;
> &gt;
& &amp;
" &quot;
Space &nbsp;
11
Colors
 Values for BGCOLOR and COLOR
 many are predefined (red, blue, green, ...)
 all colors can be specified as a six character
hexadecimal value: RRGGBB
 FF0000 – red
 888888 – gray
 004400 – dark green
 FFFF00 – yellow
12
Fonts
<FONT COLOR="red" SIZE="2" FACE="Times Roman">
This is the text of line one </FONT>
<FONT COLOR="green" SIZE="4" FACE="Arial">
Line two contains this text </FONT>
<FONT COLOR="blue" SIZE="6" FACE="Courier"
The third line has this additional text </FONT>
Note: <FONT> is now deprecated in favor of CSS.
13
Ordered (Numbered) Lists
<OL TYPE="1">
<LI> Item one </LI>
<LI> Item two </LI>
<OL TYPE="I" >
<LI> Sublist item one </LI>
<LI> Sublist item two </LI>
<OL TYPE="i">
<LI> Sub-sublist item one </LI>
<LI> Sub-sublist item two </LI>
</OL>
</OL>
</OL>
14
Unordered (Bulleted) Lists
<UL TYPE="disc">
<LI> One </LI>
<LI> Two </LI>
<UL TYPE="circle">
<LI> Three </LI>
<LI> Four </LI>
<UL TYPE="square">
<LI> Five </LI>
<LI> Six </LI>
</UL>
</UL>
</UL>
15
Physical Character Styles
<H1>Physical Character Styles</H1>
<B>Bold</B><BR>
<I>Italic</I><BR>
<TT>Teletype (Monospaced)</TT><BR>
<U>Underlined</U><BR>
Subscripts: f<SUB>0</SUB> + f<SUB>1</SUB><BR>
Superscripts: x<SUP>2</SUP> + y<SUP>2</SUP><BR>
<SMALL>Smaller</SMALL><BR>
<BIG>Bigger</BIG><BR>
<STRIKE>Strike Through</STRIKE><BR>
<B><I>Bold Italic</I></B><BR>
<BIG><TT>Big Monospaced</TT></BIG><BR>
<SMALL><I>Small Italic</I></SMALL><BR>
<FONT COLOR="GRAY">Gray</FONT><BR>
<DEL>Delete</DEL><BR>
<INS>Insert</INS><BR>
16
Logical
Character
Styles
<H1>Logical Character Styles</H1>
<EM>Emphasized</EM><BR>
<STRONG>Strongly Emphasized</STRONG><BR>
<CODE>Code</CODE><BR>
<SAMP>Sample Output</SAMP><BR>
<KBD>Keyboard Text</KBD><BR>
<DFN>Definition</DFN><BR>
<VAR>Variable</VAR><BR>
<CITE>Citation</CITE><BR>
<EM><CODE>Emphasized Code</CODE></EM><BR>
<FONT COLOR="GRAY"><CITE>Gray Citation</CITE></FONT><BR>
<ACRONYM TITLE="Java Development Kit">JDK Acronym</ACRONYM
17
<A> Anchors (HyperLinks)
Link to an absolute URL:
If you get spam, contact <A HREF="htttp:www.microsoft.com">
Microsoft </A> to report the problem.
Link to a relative URL:
See these <A HREF="#references"> references </A>
concerning our fine products.
Link to a section within a URL:
Amazon provided a <A HREF="www.amazon.com/#reference">
reference for our company. </A>
18
Naming a Section
<H2> <A NAME="#references"> Our References </A> </H2>
Example
19
Hyperlinks
<BODY>
<H3>Welcome to <A HREF="http://www.cs.virginia.edu">
<STRONG>Computer Science</STRONG></A>
at the <A HREF="www.virginia.edu">University of Virginia.</A>
</H3>
</BODY>
20
Images
 SRC is required
 WIDTH, HEIGHT may be in units of pixels or
percentage of page or frame
 WIDTH="357"
 HEIGHT="50%"
 Images scale to fit the space allowed
21
Align=position Image/Text Placement
Left Image on left edge; text flows to right of image
Right Image on right edge; text flows to left
Top Image is left; words align with top of image
Bottom Image is left; words align with bottom of image
Middle Words align with middle of image
Images
22
Images
<BODY>
<img src="dolphin.jpg" align="left" width="150" height="150" alt="dolphin
jump!">
This is a very cute dolphin on the left!<br>
This is a very cute dolphin on the left!<br>
This is a very cute dolphin on the left!<br>
This is a very cute dolphin on the left!<br>
This is a very cute dolphin on the left!<br>
This is a very cute dolphin on the left!<br>
This is a very cute dolphin on the left!<br>
This is a very cute dolphin on the left!<br>
This is a very cute dolphin on the left!<br>
This is a very cute dolphin on the left!<br>
You can see text wrap around it<br>
</BODY>
</HTML>
23
ALIGN="left"
24
ALIGN="right"
25
ALIGN=“bottom"
26
Tables
<TABLE> table tag
<CAPTION> optional table title
<TR> table row
<TH> table column header
<TD> table data element
27
Tables
<TABLE BORDER=1>
<CAPTION>Table Caption</CAPTION>
<TR><TH>Heading1</TH> <TH>Heading2</TH></TR>
<TR><TD>Row1 Col1 Data</TD><TD>Row1 Col2 Data</TD></TR>
<TR><TD>Row2 Col1 Data</TD><TD>Row2 Col2 Data</TD></TR>
<TR><TD>Row3 Col1 Data</TD><TD>Row3 Col2 Data</TD></TR>
</TABLE>
28
<TABLE> Element Attributes
 ALIGN=position -- left, center, right for table
 BORDER=number -- width in pixels of border (including any
cell spacing, default 0)
 CELLSPACING=number -- spacing in pixels between cells,
default about 3
 CELLPADDING=number -- space in pixels between cell
border and table element, default about 1
 WIDTH=number[%]-- width in pixels or percentage of
page/frame width
29
 cellspacing=10
 cellpadding=10
30
<TABLE> Element Attributes
BGCOLOR=color -- background color of table, also valid
for <TR>, <TH>, and <TD>
RULES=value -- which internal lines are shown; values are
none, rows, cols, and all (default)
EX: <TABLE COLS=“40%, *,*”>
<TABLE ROWS=“*,*”>
31
<TR> Table Row Attributes
Valid for the table row:
ALIGN -- left, center, right
VALIGN -- top, middle, bottom
BGCOLOR -- background color
<TABLE ALIGN="center" WIDTH="300" HEIGHT="200">
<TR ALIGN="left" VALIGN="top" BGCOLOR="red"><TD>One</TD><TD>Two</TD>
<TR ALIGN="center" VALIGN="middle" BGCOLOR="lightblue"><TD>Three</TD><TD>Four</TD>
<TR ALIGN="right" VALIGN="bottom" BGCOLOR="yellow"><TD>Five</TD><TD>Six</TD>
</TABLE>
32
<TD> Table Cell Attributes
Valid for the table cell:
colspan -- how many columns this cell occupies
rowspan – how many rows this cell occupies
<TABLE ALIGN="center" WIDTH="300" HEIGHT="200" border="1">
<TR>
<TD colspan="1" rowspan="2">a</TD>
<TD colspan="1" rowspan="1">b</TD>
</TR>
<TR>
<TD colspan="1" rowspan="1">c</TD>
</TR>
</TABLE>
33
Frames
 Frames help control navigation and display
 <FRAME> attributes include
 FRAMEBORDER – yes or 1 for borders
 FRAMESPACING – width of border
 BORDERCOLOR – color
 SRC – location of HTML to display in frame
 NAME – destination for TARGET attribute
34
Frames
 MARGINWIDTH – left/right margins
 MARGINHEIGHT – top/bottom margins
 SCROLLING – yes or 1 adds scroll bar
 NORESIZE – yes or 1 disables resizing
35
Frames
<FRAMESET ROWS="75%,25%">
<FRAMESET COLS="*,*,*">
<FRAME SRC="http://www.virginia.edu">
<FRAME SRC="http://www.virginia.edu">
<FRAME SRC="http://www.virginia.edu">
</FRAMESET>
<FRAMESET COLS="*,*">
<FRAME SRC="http://www.virginia.edu">
<FRAME SRC="http://www.virginia.edu">
</FRAMESET>
</FRAMESET>
36
Frames
<FRAMESET ROWS="25%,75%"
<FRAMESET COLS="*,*,*">
<FRAME SRC="http://www.virginia.edu">
<FRAME SRC="http://www.virginia.edu">
<FRAME SRC="http://www.virginia.edu">
</FRAMESET>
<FRAMESET COLS="*,*">
<FRAME SRC="http://www.virginia.edu">
<FRAME SRC="http://www.virginia.edu">
</FRAMESET>
</FRAMESET>
37
Frames
<FRAMESET ROWS="*,*">
<FRAMESET COLS="15%, 2*, *">
<FRAME SRC="http://www.cs.virginia.edu/">
<FRAME SRC="http://www.cs.virginia.edu/">
<FRAME SRC="http://www.cs.virginia.edu/">
</FRAMESET>
<FRAMESET COLS="40%, *">
<FRAME SRC="http://www.cs.virginia.edu/">
<FRAME SRC="http://www.cs.virginia.edu/">
</FRAMESET>
</FRAMESET>
38
Cascading Style Sheets
 A powerful way to specify styles and formatting
across all documents in a web site
 Style sheets can be specified inline or as a
separate document
 Helps to keep a common look and feel
39
CSS
 General form:
selector {property: value} or
selector {property1: value1;
property2: value2;
...
propertyn: valuen }
40
CSS
H1 {text-align: center;
color: blue;
font: Arial, Times New Roman}
P {text-align: left;
color: red;
font-family: Tahoma, Arial Narrow;
font-style: italics}
41
Fizzics1 (no style sheet)
<HTML>
<HEAD>
<TITLE>New Advances in Physics</TITLE>
</HEAD>
<BODY>
<H1>New Advances in Physics</H1>
<H2>Turning Gold into Lead</H2>
In a startling breakthrough, scientist B.O. "Gus" Fizzics
has invented a <STRONG>practical</STRONG> technique for
transmutation! For more details, please see
<A HREF="give-us-your-gold.html">our transmutation thesis</A>.
...
</BODY>
</HTML>
From: Core Web Programming, Marty Hall and Larry Brown, © 2002
Drop Down Menu
42
<!DOCTYPE html>
<html>
<body>
<select>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="opel">Opel</option>
<option value="audi">Audi</option>
</select>
</body>
</html>
Clickable Drop Down Menu
43
<!DOCTYPE html>
<html>
<head>
<style>
.dropbtn {
background-color: #4CAF50;
color: white;
padding: 16px;
font-size: 16px;
border: none;
cursor: pointer;
}
.dropbtn:hover, .dropbtn:focus {
background-color: #3e8e41;
}

More Related Content

PDF
Web technology lab manual
DOC
Internet programming lab manual
PPTX
HTML: Tables and Forms
DOCX
Web Technology Lab File
PDF
Html tables examples
PDF
Web Design Course: CSS lecture 2
PDF
Web Design Course: CSS lecture 1
PDF
Web Design Course: CSS lecture 3
Web technology lab manual
Internet programming lab manual
HTML: Tables and Forms
Web Technology Lab File
Html tables examples
Web Design Course: CSS lecture 2
Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 3

What's hot (20)

PDF
Html Tags
PPT
HTML 5 Tables and Forms
PPTX
Html Table
PDF
HTML Lecture Part 2 of 2
PDF
Web Design Course: CSS lecture 4
PPT
Frames tables forms
PPTX
Tables and Forms in HTML
PDF
Web Development Course: PHP lecture 2
PDF
Web I - 03 - Tables
PPTX
HTML Table
PPTX
html-table
PPTX
PPTX
PPTX
Learning HTML - ILEAD USA
PPT
Session3 part2
PDF
Html table tags
PPTX
Web design - Working with tables in HTML
PPTX
Table and Form HTML&CSS
Html Tags
HTML 5 Tables and Forms
Html Table
HTML Lecture Part 2 of 2
Web Design Course: CSS lecture 4
Frames tables forms
Tables and Forms in HTML
Web Development Course: PHP lecture 2
Web I - 03 - Tables
HTML Table
html-table
Learning HTML - ILEAD USA
Session3 part2
Html table tags
Web design - Working with tables in HTML
Table and Form HTML&CSS
Ad

Viewers also liked (20)

PDF
Html tutorial
KEY
HTML presentation for beginners
PDF
Up to Speed on HTML 5 and CSS 3
PPT
Html Ppt
PDF
Web app development_php_06
PPT
Basic html
PPTX
PPTX
Html tutorial.lesson10
PPTX
Html tutorial.lesson12
PPTX
Html tutorial.lesson9
PPTX
Adrianne’s &lt;/html> Tutorial
PPTX
HTML Forms Tutorial
PPTX
HTML Tutorial
PPTX
Html Tutorial
PPTX
Html basic
PPTX
Introduction to basic HTML [Librarian edition]
PDF
Basic html for Normal People
PDF
Php tutorial(w3schools)
PPT
HTML Tutorial: Chapters 1 & 2
PDF
Html - Tutorial
Html tutorial
HTML presentation for beginners
Up to Speed on HTML 5 and CSS 3
Html Ppt
Web app development_php_06
Basic html
Html tutorial.lesson10
Html tutorial.lesson12
Html tutorial.lesson9
Adrianne’s &lt;/html> Tutorial
HTML Forms Tutorial
HTML Tutorial
Html Tutorial
Html basic
Introduction to basic HTML [Librarian edition]
Basic html for Normal People
Php tutorial(w3schools)
HTML Tutorial: Chapters 1 & 2
Html - Tutorial
Ad

Similar to Html tutorial (20)

PPTX
HTML.pptx Web Technologies IP University
PDF
PPTX
Comp 111chp iv vi
PDF
Web Developement Workshop (Oct 2009 -Day 1)
PPTX
Presentation_ON _HTML Irfan Rashid .pptx
PPTX
Web development ppt used to design web applocation
PPT
HTML and ASP.NET
PPT
PPT
HTML (Hyper Text Markup Language) by Mukesh
PPTX
Web Design HTML for beginners and advanced learners .pptx
PPT
html-lists-tables.ppt,,,,,,,,,,,,,,,,,,,
PPT
html-lists-hdhdhdhdhddhdhdhdhdhdhdtables.ppt
PDF
Html ref guide
PDF
Unit 2 (it workshop)
PPTX
Web engineering - An overview about HTML
PDF
Introduction to Html by Ankitkumar Singh
PDF
Introduction to XML, XHTML and CSS
PPTX
HTML.pptx Web Technologies IP University
Comp 111chp iv vi
Web Developement Workshop (Oct 2009 -Day 1)
Presentation_ON _HTML Irfan Rashid .pptx
Web development ppt used to design web applocation
HTML and ASP.NET
HTML (Hyper Text Markup Language) by Mukesh
Web Design HTML for beginners and advanced learners .pptx
html-lists-tables.ppt,,,,,,,,,,,,,,,,,,,
html-lists-hdhdhdhdhddhdhdhdhdhdhdtables.ppt
Html ref guide
Unit 2 (it workshop)
Web engineering - An overview about HTML
Introduction to Html by Ankitkumar Singh
Introduction to XML, XHTML and CSS

Recently uploaded (20)

PPTX
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
PPTX
Internet___Basics___Styled_ presentation
PPTX
Introduction to Information and Communication Technology
PDF
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
PPTX
Introuction about WHO-FIC in ICD-10.pptx
PPT
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
DOCX
Unit-3 cyber security network security of internet system
PDF
Sims 4 Historia para lo sims 4 para jugar
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PDF
Paper PDF World Game (s) Great Redesign.pdf
PPTX
Digital Literacy And Online Safety on internet
PDF
Unit-1 introduction to cyber security discuss about how to secure a system
PDF
Slides PDF The World Game (s) Eco Economic Epochs.pdf
PDF
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
PPTX
international classification of diseases ICD-10 review PPT.pptx
PPTX
SAP Ariba Sourcing PPT for learning material
PPTX
innovation process that make everything different.pptx
June-4-Sermon-Powerpoint.pptx USE THIS FOR YOUR MOTIVATION
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
Internet___Basics___Styled_ presentation
Introduction to Information and Communication Technology
💰 𝐔𝐊𝐓𝐈 𝐊𝐄𝐌𝐄𝐍𝐀𝐍𝐆𝐀𝐍 𝐊𝐈𝐏𝐄𝐑𝟒𝐃 𝐇𝐀𝐑𝐈 𝐈𝐍𝐈 𝟐𝟎𝟐𝟓 💰
Introuction about WHO-FIC in ICD-10.pptx
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
SASE Traffic Flow - ZTNA Connector-1.pdf
Unit-3 cyber security network security of internet system
Sims 4 Historia para lo sims 4 para jugar
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PptxGenJS_Demo_Chart_20250317130215833.pptx
Paper PDF World Game (s) Great Redesign.pdf
Digital Literacy And Online Safety on internet
Unit-1 introduction to cyber security discuss about how to secure a system
Slides PDF The World Game (s) Eco Economic Epochs.pdf
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
international classification of diseases ICD-10 review PPT.pptx
SAP Ariba Sourcing PPT for learning material
innovation process that make everything different.pptx

Html tutorial

  • 2. 2 Definitions  WWW -- a software infrastructure layered on top of the Internet  HTTP -- HyperText Transport Protocol, layered on top of TCP  HTTPS -- secure HTTP using encryption  HTML -- HyperText Markup Language, version 4.01 is current
  • 3. 3 HTML Page Format <HTML> <HEAD> <TITLE> Qi’s web! </TITLE> </HEAD> <BODY> <H1> Hello World </H1> <! Rest of page goes here. This is a comment. > </BODY> </HTML>
  • 4. 4 BODY Element <BODY attributename="attributevalue">  Deprecated attributes (but still used)  BACKGROUND=“Sunset.jpg” (can be tiled)  BGCOLOR=color  TEXT=color  LINK=color (unvisited links)  VLINK=color (visited links)  ALINK=color (when selected)
  • 5. 5 Headings <H1 ...> text </H1> -- largest of the six <H2 ...> text </H2> <H3 ...> text </H3> <H4 ...> text </H4> <H5 ...> text </H5> <H6 ...> text </H6> -- smallest of the six ALIGN="position" --left (default), center or right
  • 6. 6 Headings <HTML> <HEAD> <TITLE>Document Headings</TITLE> </HEAD> <BODY> Samples of the six heading types: <H1>Level-1 (H1)</H1> <H2 ALIGN="center">Level-2 (H2)</H2> <H3><U>Level-3 (H3)</U></H3> <H4 ALIGN="right">Level-4 (H4)</H4> <H5>Level-5 (H5)</H5> <H6>Level-6 (H6)</H6> </BODY> </HTML>
  • 7. 7 <P> Paragraph  <P> defines a paragraph  Add ALIGN="position" (left, center, right)  Multiple <P>'s do not create blank lines  Use <BR> for blank line  Fully-specified text uses <P> and </P>  But </P> is optional
  • 8. 8 <BODY> <P>Here is some text </P> <P ALIGN="center"> Centered text </P> <P><P><P> <P ALIGN="right"> Right-justified text <! Note: no closing /P tag is not a problem> </BODY>
  • 9. 9 <PRE> Preformatted Text <PRE> if (a < b) { a++; b = c * d; } else { a--; b = (b-1)/2; } </PRE>
  • 10. 10 Special Characters Character Use < &lt; > &gt; & &amp; " &quot; Space &nbsp;
  • 11. 11 Colors  Values for BGCOLOR and COLOR  many are predefined (red, blue, green, ...)  all colors can be specified as a six character hexadecimal value: RRGGBB  FF0000 – red  888888 – gray  004400 – dark green  FFFF00 – yellow
  • 12. 12 Fonts <FONT COLOR="red" SIZE="2" FACE="Times Roman"> This is the text of line one </FONT> <FONT COLOR="green" SIZE="4" FACE="Arial"> Line two contains this text </FONT> <FONT COLOR="blue" SIZE="6" FACE="Courier" The third line has this additional text </FONT> Note: <FONT> is now deprecated in favor of CSS.
  • 13. 13 Ordered (Numbered) Lists <OL TYPE="1"> <LI> Item one </LI> <LI> Item two </LI> <OL TYPE="I" > <LI> Sublist item one </LI> <LI> Sublist item two </LI> <OL TYPE="i"> <LI> Sub-sublist item one </LI> <LI> Sub-sublist item two </LI> </OL> </OL> </OL>
  • 14. 14 Unordered (Bulleted) Lists <UL TYPE="disc"> <LI> One </LI> <LI> Two </LI> <UL TYPE="circle"> <LI> Three </LI> <LI> Four </LI> <UL TYPE="square"> <LI> Five </LI> <LI> Six </LI> </UL> </UL> </UL>
  • 15. 15 Physical Character Styles <H1>Physical Character Styles</H1> <B>Bold</B><BR> <I>Italic</I><BR> <TT>Teletype (Monospaced)</TT><BR> <U>Underlined</U><BR> Subscripts: f<SUB>0</SUB> + f<SUB>1</SUB><BR> Superscripts: x<SUP>2</SUP> + y<SUP>2</SUP><BR> <SMALL>Smaller</SMALL><BR> <BIG>Bigger</BIG><BR> <STRIKE>Strike Through</STRIKE><BR> <B><I>Bold Italic</I></B><BR> <BIG><TT>Big Monospaced</TT></BIG><BR> <SMALL><I>Small Italic</I></SMALL><BR> <FONT COLOR="GRAY">Gray</FONT><BR> <DEL>Delete</DEL><BR> <INS>Insert</INS><BR>
  • 16. 16 Logical Character Styles <H1>Logical Character Styles</H1> <EM>Emphasized</EM><BR> <STRONG>Strongly Emphasized</STRONG><BR> <CODE>Code</CODE><BR> <SAMP>Sample Output</SAMP><BR> <KBD>Keyboard Text</KBD><BR> <DFN>Definition</DFN><BR> <VAR>Variable</VAR><BR> <CITE>Citation</CITE><BR> <EM><CODE>Emphasized Code</CODE></EM><BR> <FONT COLOR="GRAY"><CITE>Gray Citation</CITE></FONT><BR> <ACRONYM TITLE="Java Development Kit">JDK Acronym</ACRONYM
  • 17. 17 <A> Anchors (HyperLinks) Link to an absolute URL: If you get spam, contact <A HREF="htttp:www.microsoft.com"> Microsoft </A> to report the problem. Link to a relative URL: See these <A HREF="#references"> references </A> concerning our fine products. Link to a section within a URL: Amazon provided a <A HREF="www.amazon.com/#reference"> reference for our company. </A>
  • 18. 18 Naming a Section <H2> <A NAME="#references"> Our References </A> </H2> Example
  • 19. 19 Hyperlinks <BODY> <H3>Welcome to <A HREF="http://www.cs.virginia.edu"> <STRONG>Computer Science</STRONG></A> at the <A HREF="www.virginia.edu">University of Virginia.</A> </H3> </BODY>
  • 20. 20 Images  SRC is required  WIDTH, HEIGHT may be in units of pixels or percentage of page or frame  WIDTH="357"  HEIGHT="50%"  Images scale to fit the space allowed
  • 21. 21 Align=position Image/Text Placement Left Image on left edge; text flows to right of image Right Image on right edge; text flows to left Top Image is left; words align with top of image Bottom Image is left; words align with bottom of image Middle Words align with middle of image Images
  • 22. 22 Images <BODY> <img src="dolphin.jpg" align="left" width="150" height="150" alt="dolphin jump!"> This is a very cute dolphin on the left!<br> This is a very cute dolphin on the left!<br> This is a very cute dolphin on the left!<br> This is a very cute dolphin on the left!<br> This is a very cute dolphin on the left!<br> This is a very cute dolphin on the left!<br> This is a very cute dolphin on the left!<br> This is a very cute dolphin on the left!<br> This is a very cute dolphin on the left!<br> This is a very cute dolphin on the left!<br> You can see text wrap around it<br> </BODY> </HTML>
  • 26. 26 Tables <TABLE> table tag <CAPTION> optional table title <TR> table row <TH> table column header <TD> table data element
  • 27. 27 Tables <TABLE BORDER=1> <CAPTION>Table Caption</CAPTION> <TR><TH>Heading1</TH> <TH>Heading2</TH></TR> <TR><TD>Row1 Col1 Data</TD><TD>Row1 Col2 Data</TD></TR> <TR><TD>Row2 Col1 Data</TD><TD>Row2 Col2 Data</TD></TR> <TR><TD>Row3 Col1 Data</TD><TD>Row3 Col2 Data</TD></TR> </TABLE>
  • 28. 28 <TABLE> Element Attributes  ALIGN=position -- left, center, right for table  BORDER=number -- width in pixels of border (including any cell spacing, default 0)  CELLSPACING=number -- spacing in pixels between cells, default about 3  CELLPADDING=number -- space in pixels between cell border and table element, default about 1  WIDTH=number[%]-- width in pixels or percentage of page/frame width
  • 30. 30 <TABLE> Element Attributes BGCOLOR=color -- background color of table, also valid for <TR>, <TH>, and <TD> RULES=value -- which internal lines are shown; values are none, rows, cols, and all (default) EX: <TABLE COLS=“40%, *,*”> <TABLE ROWS=“*,*”>
  • 31. 31 <TR> Table Row Attributes Valid for the table row: ALIGN -- left, center, right VALIGN -- top, middle, bottom BGCOLOR -- background color <TABLE ALIGN="center" WIDTH="300" HEIGHT="200"> <TR ALIGN="left" VALIGN="top" BGCOLOR="red"><TD>One</TD><TD>Two</TD> <TR ALIGN="center" VALIGN="middle" BGCOLOR="lightblue"><TD>Three</TD><TD>Four</TD> <TR ALIGN="right" VALIGN="bottom" BGCOLOR="yellow"><TD>Five</TD><TD>Six</TD> </TABLE>
  • 32. 32 <TD> Table Cell Attributes Valid for the table cell: colspan -- how many columns this cell occupies rowspan – how many rows this cell occupies <TABLE ALIGN="center" WIDTH="300" HEIGHT="200" border="1"> <TR> <TD colspan="1" rowspan="2">a</TD> <TD colspan="1" rowspan="1">b</TD> </TR> <TR> <TD colspan="1" rowspan="1">c</TD> </TR> </TABLE>
  • 33. 33 Frames  Frames help control navigation and display  <FRAME> attributes include  FRAMEBORDER – yes or 1 for borders  FRAMESPACING – width of border  BORDERCOLOR – color  SRC – location of HTML to display in frame  NAME – destination for TARGET attribute
  • 34. 34 Frames  MARGINWIDTH – left/right margins  MARGINHEIGHT – top/bottom margins  SCROLLING – yes or 1 adds scroll bar  NORESIZE – yes or 1 disables resizing
  • 35. 35 Frames <FRAMESET ROWS="75%,25%"> <FRAMESET COLS="*,*,*"> <FRAME SRC="http://www.virginia.edu"> <FRAME SRC="http://www.virginia.edu"> <FRAME SRC="http://www.virginia.edu"> </FRAMESET> <FRAMESET COLS="*,*"> <FRAME SRC="http://www.virginia.edu"> <FRAME SRC="http://www.virginia.edu"> </FRAMESET> </FRAMESET>
  • 36. 36 Frames <FRAMESET ROWS="25%,75%" <FRAMESET COLS="*,*,*"> <FRAME SRC="http://www.virginia.edu"> <FRAME SRC="http://www.virginia.edu"> <FRAME SRC="http://www.virginia.edu"> </FRAMESET> <FRAMESET COLS="*,*"> <FRAME SRC="http://www.virginia.edu"> <FRAME SRC="http://www.virginia.edu"> </FRAMESET> </FRAMESET>
  • 37. 37 Frames <FRAMESET ROWS="*,*"> <FRAMESET COLS="15%, 2*, *"> <FRAME SRC="http://www.cs.virginia.edu/"> <FRAME SRC="http://www.cs.virginia.edu/"> <FRAME SRC="http://www.cs.virginia.edu/"> </FRAMESET> <FRAMESET COLS="40%, *"> <FRAME SRC="http://www.cs.virginia.edu/"> <FRAME SRC="http://www.cs.virginia.edu/"> </FRAMESET> </FRAMESET>
  • 38. 38 Cascading Style Sheets  A powerful way to specify styles and formatting across all documents in a web site  Style sheets can be specified inline or as a separate document  Helps to keep a common look and feel
  • 39. 39 CSS  General form: selector {property: value} or selector {property1: value1; property2: value2; ... propertyn: valuen }
  • 40. 40 CSS H1 {text-align: center; color: blue; font: Arial, Times New Roman} P {text-align: left; color: red; font-family: Tahoma, Arial Narrow; font-style: italics}
  • 41. 41 Fizzics1 (no style sheet) <HTML> <HEAD> <TITLE>New Advances in Physics</TITLE> </HEAD> <BODY> <H1>New Advances in Physics</H1> <H2>Turning Gold into Lead</H2> In a startling breakthrough, scientist B.O. "Gus" Fizzics has invented a <STRONG>practical</STRONG> technique for transmutation! For more details, please see <A HREF="give-us-your-gold.html">our transmutation thesis</A>. ... </BODY> </HTML> From: Core Web Programming, Marty Hall and Larry Brown, © 2002
  • 42. Drop Down Menu 42 <!DOCTYPE html> <html> <body> <select> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="opel">Opel</option> <option value="audi">Audi</option> </select> </body> </html>
  • 43. Clickable Drop Down Menu 43 <!DOCTYPE html> <html> <head> <style> .dropbtn { background-color: #4CAF50; color: white; padding: 16px; font-size: 16px; border: none; cursor: pointer; } .dropbtn:hover, .dropbtn:focus { background-color: #3e8e41; }