SlideShare a Scribd company logo
1 of 6
WEBPROG1 – Web Programming 1 (HTML)                                            Prelim Period
                                                                                Handout #3


HTML Color Chart
    Below is the hexadecimal representation for an array of HTML background colors. The
hexadecimal value that you see displayed in each box represents the value to get the background
color of that cell.

#000000    #000033      #000066     #000099      #0000CC      #0000FF
#003300    #003333      #003366     #003399      #0033CC      #0033FF
#006600    #006633      #006666     #006699      #0066CC      #0066FF
#009900    #009933      #009966     #009999      #0099CC      #0099FF
#00CC00    #00CC33      #00CC66     #00CC99      #00CCCC      #00CCFF
#00FF00    #00FF33      #00FF66     #00FF99      #00FFCC      #00FFFF


#330000    #330033      #330066     #330099      #3300CC      #3300FF
#333300    #333333      #333366     #333399      #3333CC      #3333FF
#336600    #336633      #336666     #336699      #3366CC      #3366FF
#339900    #339933      #339966     #339999      #3399CC      #3399FF
#33CC00    #33CC33      #33CC66     #33CC99      #33CCCC      #33CCFF
#33FF00    #33FF33      #33FF66     #33FF99      #33FFCC      #33FFFF


#660000    #660033      #660066     #660099      #6600CC      #6600FF
#663300    #663333      #663366     #663399      #6633CC      #6633FF
#666600    #666633      #666666     #666699      #6666CC      #6666FF
#669900    #669933      #669966     #669999      #6699CC      #6699FF
#66CC00    #66CC33      #66CC66     #66CC99      #66CCCC      #66CCFF
#66FF00    #66FF33      #66FF66     #66FF99      #66FFCC      #66FFFF


#990000    #990033      #990066     #990099      #9900CC      #9900FF
#993300    #993333      #993366     #993399      #9933CC      #9933FF
#996600    #996633      #996666     #996699      #9966CC      #9966FF
#999900    #999933      #999966     #999999      #9999CC      #9999FF
#99CC00    #99CC33      #99CC66     #99CC99      #99CCCC      #99CCFF
#99FF00    #99FF33      #99FF66     #99FF99      #99FFCC      #99FFFF


#CC0000    #CC0033      #CC0066     #CC0099      #CC00CC      #CC00FF
#CC3300    #CC3333      #CC3366     #CC3399      #CC33CC      #CC33FF
#CC6600    #CC6633      #CC6666     #CC6699      #CC66CC      #CC66FF
#CC9900    #CC9933      #CC9966     #CC9999      #CC99CC      #CC99FF
#CCCC00    #CCCC33      #CCCC66     #CCCC99      #CCCCCC      #CCCCFF
#CCFF00    #CCFF33      #CCFF66     #CCFF99      #CCFFCC      #CCFFFF


#FF0000    #FF0033      #FF0066     #FF0099      #FF00CC      #FF00FF
#FF3300    #FF3333      #FF3366     #FF3399      #FF33CC      #FF33FF
#FF6600    #FF6633      #FF6666     #FF6699      #FF66CC      #FF66FF




Prepared By:RICHARD F. ORPIANO                                                    Page 1 of 6
WEBPROG1 – Web Programming 1 (HTML)                                                        Prelim Period
                                                                                            Handout #3


#FF9900       #FF9933       #FF9966       #FF9999       #FF99CC        #FF99FF
#FFCC00       #FFCC33       #FFCC66       #FFCC99       #FFCCCC        #FFCCFF
#FFFF00       #FFFF33       #FFFF66       #FFFF99       #FFFFCC        #FFFFFF



HTML Links and Anchors
    The web got its spidery name from the plentiful connections between web sites. These
connections are made using anchor tags to create links. Text, Images, and Forms may be used to
create these links.

    Links can be Internal, Local, or Global.

    •     Internal - Links to anchors on the current page
    •     Local - Links to other pages within your domain
    •     Global - Links to other domains outside of your site


HTML Text Links

    Use the <a></a> tags to define the start and ending of an anchor. The text you place between the
tags will be shown as the link on a page. Use the demonstration below as a reference.

    Here's a list of target attributes for links. The target attribute defines whether to open the page in a
separate window, or to open the link in the current browser window.

target=" _blank"    Opens new page in a new browser window
         _self"     Loads the new page in current window
         _parent"   Loads new page into a frame that is superior to where the link lies
         _top"      Loads new page into the current browser window, cancelling all frames

    The example below shows how you would link to ESPN.COM, a popular sports web site. The
target attribute is added to allow the browser to open ESPN in a new window, so that the viewer can
remain at our web site. Here's the example.

Code:
<a href="http://www.ESPN.com" target="_blank">ESPN.COM</a>

Display:
ESPN.COM


HTML Image Links

     Using graphics will liven up that tired bland looking text link. To make an image link simply insert
an image within the anchor tag. If you do not know how to use the image tag, skip ahead to the image
tutorial and come back after you feel comfortable with it.

Code:
<a href="http://www.espn.com" target="_blank>
<img src="ahman.gif">
</a>




Prepared By:RICHARD F. ORPIANO                                                                Page 2 of 6
WEBPROG1 – Web Programming 1 (HTML)                                                       Prelim Period
                                                                                           Handout #3


Display:




HTML Anchors
    To link to sections of your existing page a name must be given to the anchor. In the example
below, we've created a mini Table of Contents for this page. By placing blank anchors just after each
heading, and naming them, we can then create reference links to those sections on this page as
shown below.

    First, the headings of this page contain blank, named anchors. They look like this.

Tizag's Own Code:
<h1>HTML Links and Anchors<a name="top"></a></h1>
<h1>HTML Text Links<a name="text"></a></h1>
<h1>HTML Image Links<a name="imgs"></a></h1>

     Now create the reference links, placing the pound symbol followed by the name of the anchor in
the href of the new link.

Code:
<a href="#top">Go to the Top</a>
<a href="#text">Learn about Text Links</a>
<a href="#imgs">Learn about Image Links</a>

Display:
Go to the Top
Learn about Text Links
Learn about Image Link


Email Links
     Creating Email links are simple. If you want somebody to mail you about your site a good way to
do it is place an email link with a subject already inputted for them.

Code:
<a href="mailto:email@tizag.com?subject=Feedback">Email@tizag.com</a>

Display:
mailto:email@tizag.com?subject=Feedback

    In some circumstances it may be necessary to fill in the body of the Email for the user as well.

Code:
<a href="mailto:email@tizag.com?subject=Feedback&body=I think your site
rocks!">Email@tizag.com</a>

Display:
mailto:email@tizag.com?subject=Feedback&body=I think your site rocks!




Prepared By:RICHARD F. ORPIANO                                                              Page 3 of 6
WEBPROG1 – Web Programming 1 (HTML)                                                     Prelim Period
                                                                                         Handout #3




Default Links - Base
head element to set a default URL for all links on a page to go to. It's always a good idea to set a base
tag just incase your links become bugged somewhere down the line. Usually set your base to your
home page.

Code:
<head>
<base href="http://www.tizag.com/">
</head>



HTML Images
    Images are a staple of any web designer, so it is very important that you understand how to use
them properly. Use the <img> tag to place an image on your web page.

Code:
<img src="sunset.gif">
Display:




    Above we have defined the src attribute. The src attribute tells the browser where the image is
located. You can use a local path name as we did above, or you may choose to display the complete
path (i.e. http://www.tizag.com/htmlT/sunset.gif).


Image Height and Width
     To define the height and width of the image, rather than letting the browser compute the size, use
the height and width attributes.

Code:
<img src="sunset.gif" height="50" width="100">
Display:




    Above we have defined the src, height and width attributes. By informing the browser of the image
dimensions it knows to set aside a place for that image. Without defining an image's dimensions your




Prepared By:RICHARD F. ORPIANO                                                             Page 4 of 6
WEBPROG1 – Web Programming 1 (HTML)                                                      Prelim Period
                                                                                          Handout #3

site may load poorly; text and other images will be moved around when the browser finally figures out
how big the picture is supposed to be and then makes room for the picture.




Vertically and Horizontally Align Images
    Use the align and valign attributes to place images within your body, tables, or sections.

    1.   align (Horizontal)
              o right
              o left
              o center
    2.   valign (Vertical)
              o top
              o bottom
              o center

    Below is an example of how to align an image to the right of a paragraph.

Code:
<p>This is paragraph 1, yes it is...</p>
<p>
<img src="sunset.gif" align="right">
The image will appear along the...isn't it?
</p>
<p>This is the third paragraph that appears...</p>
Display:

This is paragraph 1, yes it is. I think this paragraph serves as a nice example to show how this image
alignment works.

The image will appear along the right hand side of the paragraph. As you can
see this is very nice for adding a little eye candy that relates to the specified
paragraph. If we were talking about beautiful tropical sunsets, this picture
would be perfect. But we aren't talking about that, so it's rather a waste, isn't it?

This is the third paragraph that appears below the paragraph with the image!


Images as Links
    This will be a quick review of the links - image lesson. Images are very useful for links and can be
created with the HTML below.

Code:
<a href="http://www.tizag.com/">
<img src="sunset.gif"> </a>
Display:


Prepared By:RICHARD F. ORPIANO                                                             Page 5 of 6
WEBPROG1 – Web Programming 1 (HTML)                                                       Prelim Period
                                                                                           Handout #3




   Now your image will take you to our home page when you click it. Change it to your home page
URL.


Thumbnails

     Thumbnails are small size (Kilobytes) pictures that link to the larger, high quality picture. To make
a thumbnail save a low-quality version of a picture and make it a smaller dimensions. Now make this
low-quality picture into an image link and have it point to the the high-quality picture.

Code:
<a href="sunset.gif"> <img src="thmb_sunset.gif"> </a>
Display:


HTML Gifs vs. Jpegs
     Gifs are best used for banners, clip art, and buttons. The main reason for this is that gifs can have
a transparent background which is priceless when it comes to web design. On the down side, gifs are
usually larger files, not as compressed as a jpeg, which calls for slow load times and large transfer
rates. Gifs are also limited to the 256 color scheme.

     Jpegs however, have an unlimited color wheel, and have a high compression rate downsizing
your load times and saving hard drive space. Jpegs don't allow for transparent backgrounds, but their
size/quality ratio is outstanding. Its best to use Jpegs for photo galleries, or artwork to allow the viewer
to catch that extra bit of detail. Avoid Jpegs for graphical design, stick to using them for thumbnails and
backgrounds




Prepared By:RICHARD F. ORPIANO                                                               Page 6 of 6

More Related Content

What's hot

Css 1
Css 1Css 1
Css 1
H K
 
Kml Basics Chpt 2 Placemarks
Kml Basics Chpt  2   PlacemarksKml Basics Chpt  2   Placemarks
Kml Basics Chpt 2 Placemarks
tcooper66
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
vikasgaur31
 
Html Presentation Of Web Page Making
Html Presentation Of Web Page MakingHtml Presentation Of Web Page Making
Html Presentation Of Web Page Making
Sandeep Supal
 

What's hot (18)

html
htmlhtml
html
 
Css 1
Css 1Css 1
Css 1
 
Stylesheets for Online Help - Scott DeLoach, ClickStart
Stylesheets for Online Help - Scott DeLoach, ClickStartStylesheets for Online Help - Scott DeLoach, ClickStart
Stylesheets for Online Help - Scott DeLoach, ClickStart
 
HTML (Web) basics for a beginner
HTML (Web) basics for a beginnerHTML (Web) basics for a beginner
HTML (Web) basics for a beginner
 
Class13
Class13Class13
Class13
 
Html ppt
Html pptHtml ppt
Html ppt
 
The Basics of (X)HTML Tags
The Basics of (X)HTML TagsThe Basics of (X)HTML Tags
The Basics of (X)HTML Tags
 
Html ppt
Html pptHtml ppt
Html ppt
 
Layers&Frames
Layers&FramesLayers&Frames
Layers&Frames
 
Kml Basics Chpt 2 Placemarks
Kml Basics Chpt  2   PlacemarksKml Basics Chpt  2   Placemarks
Kml Basics Chpt 2 Placemarks
 
Html Ppt
Html PptHtml Ppt
Html Ppt
 
LAMP_TRAINING_SESSION_3
LAMP_TRAINING_SESSION_3LAMP_TRAINING_SESSION_3
LAMP_TRAINING_SESSION_3
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
Html Presentation Of Web Page Making
Html Presentation Of Web Page MakingHtml Presentation Of Web Page Making
Html Presentation Of Web Page Making
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
Html introduction
Html introductionHtml introduction
Html introduction
 
Falling in Love With Forms [Breaking Development Nashville 2015]
Falling in Love With Forms [Breaking Development Nashville 2015]Falling in Love With Forms [Breaking Development Nashville 2015]
Falling in Love With Forms [Breaking Development Nashville 2015]
 
SEO Structures by Yavor Milchev
SEO Structures by Yavor MilchevSEO Structures by Yavor Milchev
SEO Structures by Yavor Milchev
 

Similar to Handout3 links

Even faster web sites presentation 3
Even faster web sites presentation 3Even faster web sites presentation 3
Even faster web sites presentation 3
Felipe Lavín
 
User manual salman alam and kyubin han
User manual   salman alam and kyubin hanUser manual   salman alam and kyubin han
User manual salman alam and kyubin han
Kyubin Han
 
Web Fundamentals And Html Chapter 1
Web Fundamentals And Html Chapter 1Web Fundamentals And Html Chapter 1
Web Fundamentals And Html Chapter 1
raileeanne
 

Similar to Handout3 links (20)

A More Perfect Union with CSS
A More Perfect Union with CSSA More Perfect Union with CSS
A More Perfect Union with CSS
 
(SEO) Search Engine Optimization
(SEO) Search Engine Optimization(SEO) Search Engine Optimization
(SEO) Search Engine Optimization
 
Magento 2 Front-end performance tips & tricks - Meet Magento Romania 2017
Magento 2 Front-end performance tips & tricks - Meet Magento Romania 2017Magento 2 Front-end performance tips & tricks - Meet Magento Romania 2017
Magento 2 Front-end performance tips & tricks - Meet Magento Romania 2017
 
Sacramento web design
Sacramento web designSacramento web design
Sacramento web design
 
Iwt assignment 1
Iwt  assignment 1Iwt  assignment 1
Iwt assignment 1
 
Css3
Css3Css3
Css3
 
HTML & CSS Training Institute in Ambala ! Batra Computer Centre
HTML & CSS Training Institute in Ambala ! Batra Computer CentreHTML & CSS Training Institute in Ambala ! Batra Computer Centre
HTML & CSS Training Institute in Ambala ! Batra Computer Centre
 
Even faster web sites presentation 3
Even faster web sites presentation 3Even faster web sites presentation 3
Even faster web sites presentation 3
 
BrightonSEO 2017 - SEO quick wins from a technical check
BrightonSEO 2017  - SEO quick wins from a technical checkBrightonSEO 2017  - SEO quick wins from a technical check
BrightonSEO 2017 - SEO quick wins from a technical check
 
User manual salman alam and kyubin han
User manual   salman alam and kyubin hanUser manual   salman alam and kyubin han
User manual salman alam and kyubin han
 
HTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptHTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.ppt
 
css.ppt
css.pptcss.ppt
css.ppt
 
css.ppt
css.pptcss.ppt
css.ppt
 
Smxl milan 2019 - Apps script for SEO
Smxl milan 2019 - Apps script for SEOSmxl milan 2019 - Apps script for SEO
Smxl milan 2019 - Apps script for SEO
 
Web Fundamentals And Html Chapter 1
Web Fundamentals And Html Chapter 1Web Fundamentals And Html Chapter 1
Web Fundamentals And Html Chapter 1
 
Accelerated Mobile Pages (AMP) in Magento
Accelerated Mobile Pages (AMP) in MagentoAccelerated Mobile Pages (AMP) in Magento
Accelerated Mobile Pages (AMP) in Magento
 
Www snapdeal com-report
Www snapdeal com-reportWww snapdeal com-report
Www snapdeal com-report
 
The Toughest Battles in SEO are Internal - Rachel Costello, Technical SEO, De...
The Toughest Battles in SEO are Internal - Rachel Costello, Technical SEO, De...The Toughest Battles in SEO are Internal - Rachel Costello, Technical SEO, De...
The Toughest Battles in SEO are Internal - Rachel Costello, Technical SEO, De...
 
Controlling Web Typography
Controlling Web TypographyControlling Web Typography
Controlling Web Typography
 
Crawling & Indexing for eCommerce Sites - Sam Taylor, BrightonSEO (Crawling &...
Crawling & Indexing for eCommerce Sites - Sam Taylor, BrightonSEO (Crawling &...Crawling & Indexing for eCommerce Sites - Sam Taylor, BrightonSEO (Crawling &...
Crawling & Indexing for eCommerce Sites - Sam Taylor, BrightonSEO (Crawling &...
 

More from Nadine Guevarra (18)

Handout5 tables
Handout5 tablesHandout5 tables
Handout5 tables
 
Handout4 lists
Handout4 listsHandout4 lists
Handout4 lists
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Questionnaire
QuestionnaireQuestionnaire
Questionnaire
 
War and man’s past
War and man’s pastWar and man’s past
War and man’s past
 
Olympics
OlympicsOlympics
Olympics
 
Mother and child
Mother and childMother and child
Mother and child
 
Lec no. 3 comp hardware components
Lec no. 3 comp hardware componentsLec no. 3 comp hardware components
Lec no. 3 comp hardware components
 
Intro to spreadsheet
Intro to spreadsheetIntro to spreadsheet
Intro to spreadsheet
 
Excel.01
Excel.01Excel.01
Excel.01
 
Robert frost 001
Robert frost 001Robert frost 001
Robert frost 001
 
On giving 001
On giving 001On giving 001
On giving 001
 
Poetry 001
Poetry 001Poetry 001
Poetry 001
 
Robert frost 001
Robert frost 001Robert frost 001
Robert frost 001
 
The river merchant's wife 001
The river merchant's wife 001The river merchant's wife 001
The river merchant's wife 001
 
Wl lecture 2 essay 001
Wl lecture 2 essay 001Wl lecture 2 essay 001
Wl lecture 2 essay 001
 

Recently uploaded

Recently uploaded (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

Handout3 links

  • 1. WEBPROG1 – Web Programming 1 (HTML) Prelim Period Handout #3 HTML Color Chart Below is the hexadecimal representation for an array of HTML background colors. The hexadecimal value that you see displayed in each box represents the value to get the background color of that cell. #000000 #000033 #000066 #000099 #0000CC #0000FF #003300 #003333 #003366 #003399 #0033CC #0033FF #006600 #006633 #006666 #006699 #0066CC #0066FF #009900 #009933 #009966 #009999 #0099CC #0099FF #00CC00 #00CC33 #00CC66 #00CC99 #00CCCC #00CCFF #00FF00 #00FF33 #00FF66 #00FF99 #00FFCC #00FFFF #330000 #330033 #330066 #330099 #3300CC #3300FF #333300 #333333 #333366 #333399 #3333CC #3333FF #336600 #336633 #336666 #336699 #3366CC #3366FF #339900 #339933 #339966 #339999 #3399CC #3399FF #33CC00 #33CC33 #33CC66 #33CC99 #33CCCC #33CCFF #33FF00 #33FF33 #33FF66 #33FF99 #33FFCC #33FFFF #660000 #660033 #660066 #660099 #6600CC #6600FF #663300 #663333 #663366 #663399 #6633CC #6633FF #666600 #666633 #666666 #666699 #6666CC #6666FF #669900 #669933 #669966 #669999 #6699CC #6699FF #66CC00 #66CC33 #66CC66 #66CC99 #66CCCC #66CCFF #66FF00 #66FF33 #66FF66 #66FF99 #66FFCC #66FFFF #990000 #990033 #990066 #990099 #9900CC #9900FF #993300 #993333 #993366 #993399 #9933CC #9933FF #996600 #996633 #996666 #996699 #9966CC #9966FF #999900 #999933 #999966 #999999 #9999CC #9999FF #99CC00 #99CC33 #99CC66 #99CC99 #99CCCC #99CCFF #99FF00 #99FF33 #99FF66 #99FF99 #99FFCC #99FFFF #CC0000 #CC0033 #CC0066 #CC0099 #CC00CC #CC00FF #CC3300 #CC3333 #CC3366 #CC3399 #CC33CC #CC33FF #CC6600 #CC6633 #CC6666 #CC6699 #CC66CC #CC66FF #CC9900 #CC9933 #CC9966 #CC9999 #CC99CC #CC99FF #CCCC00 #CCCC33 #CCCC66 #CCCC99 #CCCCCC #CCCCFF #CCFF00 #CCFF33 #CCFF66 #CCFF99 #CCFFCC #CCFFFF #FF0000 #FF0033 #FF0066 #FF0099 #FF00CC #FF00FF #FF3300 #FF3333 #FF3366 #FF3399 #FF33CC #FF33FF #FF6600 #FF6633 #FF6666 #FF6699 #FF66CC #FF66FF Prepared By:RICHARD F. ORPIANO Page 1 of 6
  • 2. WEBPROG1 – Web Programming 1 (HTML) Prelim Period Handout #3 #FF9900 #FF9933 #FF9966 #FF9999 #FF99CC #FF99FF #FFCC00 #FFCC33 #FFCC66 #FFCC99 #FFCCCC #FFCCFF #FFFF00 #FFFF33 #FFFF66 #FFFF99 #FFFFCC #FFFFFF HTML Links and Anchors The web got its spidery name from the plentiful connections between web sites. These connections are made using anchor tags to create links. Text, Images, and Forms may be used to create these links. Links can be Internal, Local, or Global. • Internal - Links to anchors on the current page • Local - Links to other pages within your domain • Global - Links to other domains outside of your site HTML Text Links Use the <a></a> tags to define the start and ending of an anchor. The text you place between the tags will be shown as the link on a page. Use the demonstration below as a reference. Here's a list of target attributes for links. The target attribute defines whether to open the page in a separate window, or to open the link in the current browser window. target=" _blank" Opens new page in a new browser window _self" Loads the new page in current window _parent" Loads new page into a frame that is superior to where the link lies _top" Loads new page into the current browser window, cancelling all frames The example below shows how you would link to ESPN.COM, a popular sports web site. The target attribute is added to allow the browser to open ESPN in a new window, so that the viewer can remain at our web site. Here's the example. Code: <a href="http://www.ESPN.com" target="_blank">ESPN.COM</a> Display: ESPN.COM HTML Image Links Using graphics will liven up that tired bland looking text link. To make an image link simply insert an image within the anchor tag. If you do not know how to use the image tag, skip ahead to the image tutorial and come back after you feel comfortable with it. Code: <a href="http://www.espn.com" target="_blank> <img src="ahman.gif"> </a> Prepared By:RICHARD F. ORPIANO Page 2 of 6
  • 3. WEBPROG1 – Web Programming 1 (HTML) Prelim Period Handout #3 Display: HTML Anchors To link to sections of your existing page a name must be given to the anchor. In the example below, we've created a mini Table of Contents for this page. By placing blank anchors just after each heading, and naming them, we can then create reference links to those sections on this page as shown below. First, the headings of this page contain blank, named anchors. They look like this. Tizag's Own Code: <h1>HTML Links and Anchors<a name="top"></a></h1> <h1>HTML Text Links<a name="text"></a></h1> <h1>HTML Image Links<a name="imgs"></a></h1> Now create the reference links, placing the pound symbol followed by the name of the anchor in the href of the new link. Code: <a href="#top">Go to the Top</a> <a href="#text">Learn about Text Links</a> <a href="#imgs">Learn about Image Links</a> Display: Go to the Top Learn about Text Links Learn about Image Link Email Links Creating Email links are simple. If you want somebody to mail you about your site a good way to do it is place an email link with a subject already inputted for them. Code: <a href="mailto:email@tizag.com?subject=Feedback">Email@tizag.com</a> Display: mailto:email@tizag.com?subject=Feedback In some circumstances it may be necessary to fill in the body of the Email for the user as well. Code: <a href="mailto:email@tizag.com?subject=Feedback&body=I think your site rocks!">Email@tizag.com</a> Display: mailto:email@tizag.com?subject=Feedback&body=I think your site rocks! Prepared By:RICHARD F. ORPIANO Page 3 of 6
  • 4. WEBPROG1 – Web Programming 1 (HTML) Prelim Period Handout #3 Default Links - Base head element to set a default URL for all links on a page to go to. It's always a good idea to set a base tag just incase your links become bugged somewhere down the line. Usually set your base to your home page. Code: <head> <base href="http://www.tizag.com/"> </head> HTML Images Images are a staple of any web designer, so it is very important that you understand how to use them properly. Use the <img> tag to place an image on your web page. Code: <img src="sunset.gif"> Display: Above we have defined the src attribute. The src attribute tells the browser where the image is located. You can use a local path name as we did above, or you may choose to display the complete path (i.e. http://www.tizag.com/htmlT/sunset.gif). Image Height and Width To define the height and width of the image, rather than letting the browser compute the size, use the height and width attributes. Code: <img src="sunset.gif" height="50" width="100"> Display: Above we have defined the src, height and width attributes. By informing the browser of the image dimensions it knows to set aside a place for that image. Without defining an image's dimensions your Prepared By:RICHARD F. ORPIANO Page 4 of 6
  • 5. WEBPROG1 – Web Programming 1 (HTML) Prelim Period Handout #3 site may load poorly; text and other images will be moved around when the browser finally figures out how big the picture is supposed to be and then makes room for the picture. Vertically and Horizontally Align Images Use the align and valign attributes to place images within your body, tables, or sections. 1. align (Horizontal) o right o left o center 2. valign (Vertical) o top o bottom o center Below is an example of how to align an image to the right of a paragraph. Code: <p>This is paragraph 1, yes it is...</p> <p> <img src="sunset.gif" align="right"> The image will appear along the...isn't it? </p> <p>This is the third paragraph that appears...</p> Display: This is paragraph 1, yes it is. I think this paragraph serves as a nice example to show how this image alignment works. The image will appear along the right hand side of the paragraph. As you can see this is very nice for adding a little eye candy that relates to the specified paragraph. If we were talking about beautiful tropical sunsets, this picture would be perfect. But we aren't talking about that, so it's rather a waste, isn't it? This is the third paragraph that appears below the paragraph with the image! Images as Links This will be a quick review of the links - image lesson. Images are very useful for links and can be created with the HTML below. Code: <a href="http://www.tizag.com/"> <img src="sunset.gif"> </a> Display: Prepared By:RICHARD F. ORPIANO Page 5 of 6
  • 6. WEBPROG1 – Web Programming 1 (HTML) Prelim Period Handout #3 Now your image will take you to our home page when you click it. Change it to your home page URL. Thumbnails Thumbnails are small size (Kilobytes) pictures that link to the larger, high quality picture. To make a thumbnail save a low-quality version of a picture and make it a smaller dimensions. Now make this low-quality picture into an image link and have it point to the the high-quality picture. Code: <a href="sunset.gif"> <img src="thmb_sunset.gif"> </a> Display: HTML Gifs vs. Jpegs Gifs are best used for banners, clip art, and buttons. The main reason for this is that gifs can have a transparent background which is priceless when it comes to web design. On the down side, gifs are usually larger files, not as compressed as a jpeg, which calls for slow load times and large transfer rates. Gifs are also limited to the 256 color scheme. Jpegs however, have an unlimited color wheel, and have a high compression rate downsizing your load times and saving hard drive space. Jpegs don't allow for transparent backgrounds, but their size/quality ratio is outstanding. Its best to use Jpegs for photo galleries, or artwork to allow the viewer to catch that extra bit of detail. Avoid Jpegs for graphical design, stick to using them for thumbnails and backgrounds Prepared By:RICHARD F. ORPIANO Page 6 of 6