Title: Basic HTML tags
1Basic HTML tags
- Beginning Web Site Design Stanford University
Continuing Studies CS 21 - http//www.geocities.com/stanfordcs21/
2Structural Tags
- ltHTMLgt
- These tags enclose the entire Web page
document. - lt/HTMLgt
- ltHEADgt
- These tags enclose the Head part of the
document - lt/HEADgt
- ltTITLEgtThese tags enclose the title of the
document. This text appears in the title bar in
the browser and on the bookmark list if someone
bookmarks your web page. - lt/TITLEgt
3Sample Structure of a Web Site
- ltHTMLgt
- ltHEADgt
- ltTITLEgt John Q. Public's Web Page lt/TITLEgt
- lt/HEADgt
- ltBODYgt
- This is John Public's Webpage!
- lt/BODYgt
- lt/HTMLgt
4Header Tags
- Header Tags -- Used for marking sections and
subsections in a document. - ltH1gtHeader 1 -- Giant-sized and bold lt/H1gt
- ltH2gtHeader 2 -- Large and bold lt/H2gt
- ltH3gtHeader 3 -- Normal-sized and bold lt/H3gt
- ltH4gtHeader 4 -- Small and bold lt/H4gt
- ltH5gtHeader 5 -- Very Small and bold lt/H5gt
- ltH6gtHeader 6 -- Tiny and bold lt/H6gt
5Header Tags (cont.)
- H1 Giant-sized and bold
- H2 Large and bold
- H3 Normal-sized and bold
- H4 Small and bold
- H5 Very Small and bold
- H6 Tiny and bold
6Breaking Lines and Paragraphs
- ltPgt text lt/Pgt
- Paragraph tag
- Most browsers render (process) this with blank
lines between each paragraph - ltBRgt
- Line break tag
- Used when the webmaster wants a carriage return
but doesn't want a blank line to follow
Example text a ltpgttext alt/pgt ltpgttext
blt/pgt text b ltbrgttext c ltbrgttext
d text c text d
7Horizontal Rule
- The ltHRgt tag puts a graphical line across the
page. - Ex
- Horizontal Rule Attributes
- NOSHADE -- A solid line with no shading
- WIDTH"xx/xx" -- Controls the width of the line.
You may specify either percentage of the
width of a page or actual pixel length - SIZE"xx" -- Controls the height of the line.
You need to specify the - dimension in pixels.
- ALIGN"left/center/right" -- This allows the line
to be aligned to the left, - right, or center of the page
8Text Formatting Tags
- Some basic text formatting styles
- Tag Result
- ltIgt Italics lt/Igt Italics
- ltBgt Bold lt/Bgt Bold
- ltPREgt Preformatted Text lt/PREgt Preformatted Text
- ltSTRONGgt Strong lt/STRONGgt Strong
- ltADDRESSgt Address lt/ADDRESSgt Address
- ltCITEgt Citations lt/CITEgt Citations
- ltCODEgt Source Code lt/CODEgt Source Code
9Font modifications
- Web creators can also change the way text looks
by using the ltFONTgt tag - SIZE"number" - changes size of the font
1smallest, 7 largest ltFONT SIZE"7"gtBiglt/FONTgt
ltFONT SIZE"1"gtSmalllt/FONTgt - Big Small
- COLOR"color-name" - changes text color
- ltFONT COLOR"red"gtThis is redlt/FONTgt
- This is red
- FACE"font-name" - changes font
- ltFONT FACE"verdana"gtThis is the verdana
fontlt/FONTgt ltFONT FACE"chicago"gtthis is the
chicago font.lt/FONTgt - This is the verdana font this is chicago
font.
10ltFontgt modifications (cont.)
- One can combine font modifications
- ltFONT SIZE"7" FACE"courier" COLOR"red"gtBig,
Courier Redlt/FONTgt - Big, Courier Red
- ltFONT SIZE"7"gtltFONT FACE"courier"gtBig
Courierlt/FONTgt - Just Biglt/FONTgt - Big Courier - Just Big
11Lists -- Unordered Lists
- Unordered lists
- ltULgt
- ltLIgtItem One
- ltLIgtItem Two
- ltLIgtItem Three
- ltLIgtItem Four
- lt/ULgt
- Item One
- Item Two
- Item Three
- Item Four
- Unordered List Attributes
- type"disc/circle/square"
- Disc (default) ? Circle ? Square
12Lists -- Ordered Lists
- ltOLgt
- ltLIgt Item One
- ltLIgt Item Two
- ltLIgt Item Three
- ltLIgt Item Four
- lt/OLgt
Ordered (Numbered) Lists Ordered List
Attributes
1. Item One 2. Item Two 3. Item Three 4. Item Four
- type"i/I/a/A/1" (default)
- i i. Item One I I. Item One a a. Item
One A A. Item One 1 1.Item One - ii. Item Two II. Item Two b. Item Two B.
Item Two 2. Item Two - iii. Item Three III. Item Three c. Item
Three C. Item Three 3. Item Three - iv. Item Four IV. Item Four d. Item Four D.
Item Four 4. Item Four - start"xx"
- This attribute lets you specify which
number/letter will start the list
13Lists -- Definition Lists
- Definition Lists
- ltDLgt
- ltDTgtList Name One
- ltDDgtThis is where information about List Name
One would golt/DDgt - lt/DTgt
- ltDTgtList Name Two
- ltDDgtThis is where information about List Name
Two would golt/DDgt - lt/DTgt
- lt/DLgt
-
List Name One This is where information about
List Name One would go List Name Two This is
where information about List Name Two would go
14Links
- The anchor tag ltAgt is used to link one document
to another or from one part of a document to
another part of the same document. - Basic Links
- ltA HREF"http//www.stanford.edu/"gtStanford
Universitylt/Agt - Inter-document Links
- ltA HREF"spot"gtPoint to 'spot' in this
documentlt/Agt - Defining a point in a document
- ltA NAME"spot"gtSpotlt/Agt
- Email links
- ltA HREF"mailtosomeone_at_somehost.com"gtEmail
someone_at_somehost.comlt/Agt
15Graphics
- To have a graphic appear on a webpage, web
designers must to put the ltIMGgt tag in with the
address where the graphic "lives" - ltIMG SRC"http//www.someplace.com/images/fish.gif
"gt - Graphics attributes
- alt"text" insert a description of the graphic
for those who are using browsers that cannot
process images (e.g., page readers for the
blind) - width"xx/xx" width in pixels/percentage
- height"xx/xx" height in pixels/percentage
- border"xx" pixel length of the border
surrounding the image. - hspace"xx" places a buffer of space
horizontally around the image - vspace"xx" places a buffer of space vertically
around the image - align"top/middle/bottom/right/left" aligns
image in relation to the text (see next 2 slides)
16Graphics (cont.)
- ltimg src"http//www.someplace.com/images/fish.gif
" align"top"gtAll about Fish - ltimg src"http//www.someplace.com/images/fish.gif
" align"middle"gtAll about Fish - ltimg src"http//www.someplace.com/images/fish.gif
" align"bottom"gtAll about Fish
All about Fish
All about Fish
All about Fish
17Graphics (cont.)
ltimg src"http//www.someplace.com/images/fish.gif
" align"left"gt ltimg src"http//www.somepl
ace.com/images/fish.gif" align"right"gt