SlideShare une entreprise Scribd logo
1  sur  24
Links & Navigation
                  <and presentation with css />




Advanced CSS                                      Stephen Ireland
Links

    How the web works - we need to get it right

• Conventions should be followed
• Links should stand out on a page
• Differentiate from body text, preferably with some kind of
    hover effect
• Make something look and act like a button      - it becomes
    easier to understand what it does




Advanced CSS                                          Stephen Ireland
Anatomy of a Link

                                          Relative link within site


         <a href=”index.html”>Link text goes here</a>


         <a href=”pages/contact.html”>Contact us</a>


         <a href=”http://www.google.com”>Google</a>



need http:// if linking to an external website


Advanced CSS                                              Stephen Ireland
States of a Link

    A link has four states of activity
• Unvisited
• Hover
• Active
• Visited




Advanced CSS                             Stephen Ireland
States of a Link

    What the states mean
• Unvisited - user has not visited the link location
• Hover - user is hovering over the link (mouse or keyboard)
• Active - user has clicked down but not released
• Visited - user has visited the location the link points to



    Why do we need to know this? Because we can control the
    physical appearance of each state using CSS.



Advanced CSS                                             Stephen Ireland
Referenced in CSS
    State             CSS selector    Default appearance

• Unvisited           a:link          blue, underlined
• Hover               a:hover         blue, underlined
• Active              a:active        red, underlined
• Visited             a:visited       purple, underlined



    The default appearance of an html link is ugly. CSS gives us
    ultimate control to change the appearance of the link and its
    various states.


Advanced CSS                                               Stephen Ireland
Examples of Styled Link




Advanced CSS              Stephen Ireland
Link Styles

    What we have control over
• Text colour (color)
• Font family and style
• Background colour
• Decoration (Underline, strike-through, etc)
• And more


    Links are inline elements, however we can force them to
    behave like block-level elements using display: block;



Advanced CSS                                            Stephen Ireland
How Styles are Applied

    CSS
    a:link, a:visited {               All links visited or
        text-decoration: underline;   unvisited will be green
        color: #b3ff3d;               and underlined.
    }


    a:hover {                         When hovering over the
        text-decoration: none;        link, the underline will
        color: #000000;               disappear and the link
    }                                 text will appear black.

Advanced CSS                                            Stephen Ireland
Be More Specific

    CSS
    p a:link, p a:visited {                All links in a paragraph
        text-decoration: underline;        visited or unvisited
        color: #b3ff3d;                    will be green and
    }                                      underlined.


    In many cases we need to be more specific with our CSS
    styles. The CSS rule above will only affect links within
    paragraph tags.



Advanced CSS                                                   Stephen Ireland
Navigation and Links

    What’s the difference?
• Navigation is really a group of
    carefully considered links.
• Gives structure and consistency
    to a website.
• Helps visitors around the site,
    and get back to the homepage.


    Good navigation should allow a visitor to quickly find what
    they are looking for on your site.

Advanced CSS                                             Stephen Ireland
HTML Markup for Navigation

    Example HTML
    <div id=”navigation”>
        <ul>
               <li><a href=”page1.html”>Page 1</a></li>
               <li><a href=”page2.html”>Page 2</a></li>
               <li><a href=”page3.html”>Page 3</a></li>
               <li><a href=”page4.html”>Page 4</a></li>
               <li><a href=”page5.html”>Page 5</a></li>
        </ul>
    </div>


Advanced CSS                                              Stephen Ireland
Horizontal or Vertical?

    Example HTML
    <div id=”navigation”>
        <ul>
               <li><a href=”page1.html”>Page 1</a></li>
               <li><a href=”page2.html”>Page 2</a></li>
          Use this HTML markup whether you
         <li><a href=”page3.html”>Page 3</a></li>
        want your navigation to flow vertically or
         <li><a href=”page4.html”>Page 4</a></li>
                        horizontally.
               <li><a href=”page5.html”>Page 5</a></li>
        </ul>
    </div>


Advanced CSS                                              Stephen Ireland
Why?

    Example HTML
    <div id=”navigation”>
        <ul>
               <li><a href=”page1.html”>Page 1</a></li>
               Because whether navigation displays
               <li><a href=”page2.html”>Page 2</a></li>
                   horizontally or vertically, it is a
               <li><a href=”page3.html”>Page 3</a></li>
           presentational consideration, therefore
            <li><a href=”page4.html”>Page 4</a></li>
                      controlled using CSS.
            <li><a href=”page5.html”>Page 5</a></li>
        </ul>
    </div>


Advanced CSS                                              Stephen Ireland
Applying Styles

               Unstyled   Styled




Advanced CSS                       Stephen Ireland
Step One: Ground Rules
    We apply some basic styles to the navigation div.


    CSS

    #navigation {
               width: 200px;
               font-family: “Lucida Grande”, “Trebuchet MS”, sans-serif;
               font-size: 80%;
               font-weight: bold;
    }


Advanced CSS                                                   Stephen Ireland
Step Two: Reset Browser Defaults
    Reset margin and padding on the Unordered List to 0.


    CSS

    #navigation ul {
               margin: 0;
               padding: 0;
    }




Advanced CSS                                           Stephen Ireland
Step Three: Style the <li>
    Remove the bullet from the list-item and put a coloured
    border in place.


    CSS

    #navigation ul li {
               list-style: none;
               border-bottom: 1px solid #b64926;
    }



Advanced CSS                                            Stephen Ireland
Step Four: Colour and Block
    Style the link, display: block; converts the link into a clickable
    block area.


    CSS
    #navigation ul li a:link, #navigation ul li a:visited {
               display: block;
               padding: 8px 12px;
               text-decoration: none;
               background-color: #8e2800;
               color: #fff0ab;
    }
Advanced CSS                                                  Stephen Ireland
Step Five: Hover State
    Create a roll-over style for the navigation - by changing the
    background colour of the link.


    CSS

    #navigation ul li a:hover {
               background-color: #468966;
    }




Advanced CSS                                              Stephen Ireland
Your Vertical Nav Bar




                        But what if we want it
                        to display horizontally?




Advanced CSS                               Stephen Ireland
Horizontal Navigation
    Remove the contraining width...


    CSS

    #navigation {
        /*width: 200px;*/
        font-family: “Lucida Grande”, “Trebuchet MS”, sans-serif;
        font-size: 80%;
        font-weight: bold;
    }


Advanced CSS                                              Stephen Ireland
Horizontal Navigation
    Float the list-items left, and change the border to right.


    CSS

    #navigation ul li {
        list-style: none;
        border-right: 1px solid #b64926;
        float: left;
    }




Advanced CSS                                              Stephen Ireland
Completed



               Your horizontal navigation




Advanced CSS                                Stephen Ireland

Contenu connexe

Tendances

How to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - SacramentoHow to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - SacramentoSuzette Franck
 
Spectrum 2015 going online with style - an intro to css
Spectrum 2015   going online with style - an intro to cssSpectrum 2015   going online with style - an intro to css
Spectrum 2015 going online with style - an intro to cssNeil Perlin
 
Cascading Style Sheets - Part 02
Cascading Style Sheets - Part 02Cascading Style Sheets - Part 02
Cascading Style Sheets - Part 02Hatem Mahmoud
 
Maintainable CSS
Maintainable CSSMaintainable CSS
Maintainable CSSStephen Hay
 
CSS Frameworks
CSS FrameworksCSS Frameworks
CSS FrameworksMike Crabb
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media QueriesRuss Weakley
 
Web topic 14 cascading style sheets
Web topic 14  cascading style sheetsWeb topic 14  cascading style sheets
Web topic 14 cascading style sheetsCK Yang
 
How to use CSS3 in WordPress
How to use CSS3 in WordPressHow to use CSS3 in WordPress
How to use CSS3 in WordPressSuzette Franck
 
Intro to css & sass
Intro to css & sassIntro to css & sass
Intro to css & sassSean Wolfe
 

Tendances (20)

How to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - SacramentoHow to use CSS3 in WordPress - Sacramento
How to use CSS3 in WordPress - Sacramento
 
CSS Fundamentals
CSS FundamentalsCSS Fundamentals
CSS Fundamentals
 
CSS Reset
CSS ResetCSS Reset
CSS Reset
 
CSS Introduction
CSS IntroductionCSS Introduction
CSS Introduction
 
Spectrum 2015 going online with style - an intro to css
Spectrum 2015   going online with style - an intro to cssSpectrum 2015   going online with style - an intro to css
Spectrum 2015 going online with style - an intro to css
 
Cascading Style Sheets - Part 02
Cascading Style Sheets - Part 02Cascading Style Sheets - Part 02
Cascading Style Sheets - Part 02
 
Maintainable CSS
Maintainable CSSMaintainable CSS
Maintainable CSS
 
Html Expression Web
Html Expression WebHtml Expression Web
Html Expression Web
 
The Dark Arts of CSS
The Dark Arts of CSSThe Dark Arts of CSS
The Dark Arts of CSS
 
CSS Frameworks
CSS FrameworksCSS Frameworks
CSS Frameworks
 
css-tutorial
css-tutorialcss-tutorial
css-tutorial
 
CSS3 Media Queries
CSS3 Media QueriesCSS3 Media Queries
CSS3 Media Queries
 
Web topic 14 cascading style sheets
Web topic 14  cascading style sheetsWeb topic 14  cascading style sheets
Web topic 14 cascading style sheets
 
Web 102 INtro to CSS
Web 102  INtro to CSSWeb 102  INtro to CSS
Web 102 INtro to CSS
 
Artdm171 Week5 Css
Artdm171 Week5 CssArtdm171 Week5 Css
Artdm171 Week5 Css
 
Intro to SASS CSS
Intro to SASS CSSIntro to SASS CSS
Intro to SASS CSS
 
Intro to CSS
Intro to CSSIntro to CSS
Intro to CSS
 
How to use CSS3 in WordPress
How to use CSS3 in WordPressHow to use CSS3 in WordPress
How to use CSS3 in WordPress
 
Intro to css & sass
Intro to css & sassIntro to css & sass
Intro to css & sass
 
Less css
Less cssLess css
Less css
 

En vedette

Granverdad
GranverdadGranverdad
GranverdadRURDY
 
Elecciones Aut Muni 2007 Jv
Elecciones Aut Muni 2007 JvElecciones Aut Muni 2007 Jv
Elecciones Aut Muni 2007 Jvkrimendez
 
şehitlerimiz
şehitlerimizşehitlerimiz
şehitlerimizcagatay08
 
IBM MQ Overview (IBM Message Queue)
IBM MQ Overview (IBM Message Queue)IBM MQ Overview (IBM Message Queue)
IBM MQ Overview (IBM Message Queue)Juarez Junior
 
White Label Mobile OTT Solutions
White Label Mobile OTT SolutionsWhite Label Mobile OTT Solutions
White Label Mobile OTT SolutionsREVE Systems
 
Daily Snapshot - December 21st
Daily Snapshot - December 21stDaily Snapshot - December 21st
Daily Snapshot - December 21stTracxn
 
Daily Snapshot - 2nd Feb 2017
Daily Snapshot - 2nd Feb 2017Daily Snapshot - 2nd Feb 2017
Daily Snapshot - 2nd Feb 2017Tracxn
 
Las regiones naturales del Perú
Las regiones naturales del PerúLas regiones naturales del Perú
Las regiones naturales del Perúkaren_elizabeth
 

En vedette (14)

Tp tecnología grupo de luciana rey
Tp tecnología grupo de luciana reyTp tecnología grupo de luciana rey
Tp tecnología grupo de luciana rey
 
Trabajo practico
Trabajo practicoTrabajo practico
Trabajo practico
 
Granverdad
GranverdadGranverdad
Granverdad
 
Mon quartier
Mon quartierMon quartier
Mon quartier
 
Tecnologías inteligentes
Tecnologías inteligentesTecnologías inteligentes
Tecnologías inteligentes
 
Elecciones Aut Muni 2007 Jv
Elecciones Aut Muni 2007 JvElecciones Aut Muni 2007 Jv
Elecciones Aut Muni 2007 Jv
 
şehitlerimiz
şehitlerimizşehitlerimiz
şehitlerimiz
 
IBM MQ Overview (IBM Message Queue)
IBM MQ Overview (IBM Message Queue)IBM MQ Overview (IBM Message Queue)
IBM MQ Overview (IBM Message Queue)
 
White Label Mobile OTT Solutions
White Label Mobile OTT SolutionsWhite Label Mobile OTT Solutions
White Label Mobile OTT Solutions
 
Anticoncepción.pptx gine
Anticoncepción.pptx gineAnticoncepción.pptx gine
Anticoncepción.pptx gine
 
Daily Snapshot - December 21st
Daily Snapshot - December 21stDaily Snapshot - December 21st
Daily Snapshot - December 21st
 
Daily Snapshot - 2nd Feb 2017
Daily Snapshot - 2nd Feb 2017Daily Snapshot - 2nd Feb 2017
Daily Snapshot - 2nd Feb 2017
 
Las regiones naturales del Perú
Las regiones naturales del PerúLas regiones naturales del Perú
Las regiones naturales del Perú
 
Refleja Dolor
Refleja   DolorRefleja   Dolor
Refleja Dolor
 

Similaire à Links and Navigation

Web-03-CSS.ppt
Web-03-CSS.pptWeb-03-CSS.ppt
Web-03-CSS.pptjoeveller
 
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.pptwaxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.pptIsmaciil2
 
Css few small tips and information
Css few small tips and informationCss few small tips and information
Css few small tips and informationNaga Harish M
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Erin M. Kidwell
 
BITM3730 9-26.pptx
BITM3730 9-26.pptxBITM3730 9-26.pptx
BITM3730 9-26.pptxMattMarino13
 
3 coding101 fewd_lesson3_your_first_website 20210105
3 coding101 fewd_lesson3_your_first_website 202101053 coding101 fewd_lesson3_your_first_website 20210105
3 coding101 fewd_lesson3_your_first_website 20210105John Picasso
 
BITM3730 9-27.pptx
BITM3730 9-27.pptxBITM3730 9-27.pptx
BITM3730 9-27.pptxMattMarino13
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheetstutorialsruby
 
Responsive Design in Drupal with Zen and Zen Grids
Responsive Design in Drupal with Zen and Zen GridsResponsive Design in Drupal with Zen and Zen Grids
Responsive Design in Drupal with Zen and Zen GridsSuzanne Dergacheva
 

Similaire à Links and Navigation (20)

Web-03-CSS.ppt
Web-03-CSS.pptWeb-03-CSS.ppt
Web-03-CSS.ppt
 
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.pptwaxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
waxaada canshuurahaiyosiyaaddaguudeexamarwaaardaydaDAALBADAN.ppt
 
css1.ppt
css1.pptcss1.ppt
css1.ppt
 
html-css
html-csshtml-css
html-css
 
Css few small tips and information
Css few small tips and informationCss few small tips and information
Css few small tips and information
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
 
CSS
CSSCSS
CSS
 
Sacramento web design
Sacramento web designSacramento web design
Sacramento web design
 
Css group
Css groupCss group
Css group
 
Css group
Css groupCss group
Css group
 
Css group
Css groupCss group
Css group
 
David Weliver
David WeliverDavid Weliver
David Weliver
 
BITM3730 9-26.pptx
BITM3730 9-26.pptxBITM3730 9-26.pptx
BITM3730 9-26.pptx
 
3 coding101 fewd_lesson3_your_first_website 20210105
3 coding101 fewd_lesson3_your_first_website 202101053 coding101 fewd_lesson3_your_first_website 20210105
3 coding101 fewd_lesson3_your_first_website 20210105
 
Css1
Css1Css1
Css1
 
Thuray css3
Thuray css3Thuray css3
Thuray css3
 
BITM3730 9-27.pptx
BITM3730 9-27.pptxBITM3730 9-27.pptx
BITM3730 9-27.pptx
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
cascadingstylesheets
cascadingstylesheetscascadingstylesheets
cascadingstylesheets
 
Responsive Design in Drupal with Zen and Zen Grids
Responsive Design in Drupal with Zen and Zen GridsResponsive Design in Drupal with Zen and Zen Grids
Responsive Design in Drupal with Zen and Zen Grids
 

Dernier

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
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 2024Rafal Los
 
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...Martijn de Jong
 
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 Takeoffsammart93
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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 2024The Digital Insurer
 
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...Neo4j
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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.pdfUK Journal
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
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 WoodJuan lago vázquez
 
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)wesley chun
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Dernier (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
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...
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
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...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life 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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
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
 
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)
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

Links and Navigation

  • 1. Links & Navigation <and presentation with css /> Advanced CSS Stephen Ireland
  • 2. Links How the web works - we need to get it right • Conventions should be followed • Links should stand out on a page • Differentiate from body text, preferably with some kind of hover effect • Make something look and act like a button - it becomes easier to understand what it does Advanced CSS Stephen Ireland
  • 3. Anatomy of a Link Relative link within site <a href=”index.html”>Link text goes here</a> <a href=”pages/contact.html”>Contact us</a> <a href=”http://www.google.com”>Google</a> need http:// if linking to an external website Advanced CSS Stephen Ireland
  • 4. States of a Link A link has four states of activity • Unvisited • Hover • Active • Visited Advanced CSS Stephen Ireland
  • 5. States of a Link What the states mean • Unvisited - user has not visited the link location • Hover - user is hovering over the link (mouse or keyboard) • Active - user has clicked down but not released • Visited - user has visited the location the link points to Why do we need to know this? Because we can control the physical appearance of each state using CSS. Advanced CSS Stephen Ireland
  • 6. Referenced in CSS State CSS selector Default appearance • Unvisited a:link blue, underlined • Hover a:hover blue, underlined • Active a:active red, underlined • Visited a:visited purple, underlined The default appearance of an html link is ugly. CSS gives us ultimate control to change the appearance of the link and its various states. Advanced CSS Stephen Ireland
  • 7. Examples of Styled Link Advanced CSS Stephen Ireland
  • 8. Link Styles What we have control over • Text colour (color) • Font family and style • Background colour • Decoration (Underline, strike-through, etc) • And more Links are inline elements, however we can force them to behave like block-level elements using display: block; Advanced CSS Stephen Ireland
  • 9. How Styles are Applied CSS a:link, a:visited { All links visited or text-decoration: underline; unvisited will be green color: #b3ff3d; and underlined. } a:hover { When hovering over the text-decoration: none; link, the underline will color: #000000; disappear and the link } text will appear black. Advanced CSS Stephen Ireland
  • 10. Be More Specific CSS p a:link, p a:visited { All links in a paragraph text-decoration: underline; visited or unvisited color: #b3ff3d; will be green and } underlined. In many cases we need to be more specific with our CSS styles. The CSS rule above will only affect links within paragraph tags. Advanced CSS Stephen Ireland
  • 11. Navigation and Links What’s the difference? • Navigation is really a group of carefully considered links. • Gives structure and consistency to a website. • Helps visitors around the site, and get back to the homepage. Good navigation should allow a visitor to quickly find what they are looking for on your site. Advanced CSS Stephen Ireland
  • 12. HTML Markup for Navigation Example HTML <div id=”navigation”> <ul> <li><a href=”page1.html”>Page 1</a></li> <li><a href=”page2.html”>Page 2</a></li> <li><a href=”page3.html”>Page 3</a></li> <li><a href=”page4.html”>Page 4</a></li> <li><a href=”page5.html”>Page 5</a></li> </ul> </div> Advanced CSS Stephen Ireland
  • 13. Horizontal or Vertical? Example HTML <div id=”navigation”> <ul> <li><a href=”page1.html”>Page 1</a></li> <li><a href=”page2.html”>Page 2</a></li> Use this HTML markup whether you <li><a href=”page3.html”>Page 3</a></li> want your navigation to flow vertically or <li><a href=”page4.html”>Page 4</a></li> horizontally. <li><a href=”page5.html”>Page 5</a></li> </ul> </div> Advanced CSS Stephen Ireland
  • 14. Why? Example HTML <div id=”navigation”> <ul> <li><a href=”page1.html”>Page 1</a></li> Because whether navigation displays <li><a href=”page2.html”>Page 2</a></li> horizontally or vertically, it is a <li><a href=”page3.html”>Page 3</a></li> presentational consideration, therefore <li><a href=”page4.html”>Page 4</a></li> controlled using CSS. <li><a href=”page5.html”>Page 5</a></li> </ul> </div> Advanced CSS Stephen Ireland
  • 15. Applying Styles Unstyled Styled Advanced CSS Stephen Ireland
  • 16. Step One: Ground Rules We apply some basic styles to the navigation div. CSS #navigation { width: 200px; font-family: “Lucida Grande”, “Trebuchet MS”, sans-serif; font-size: 80%; font-weight: bold; } Advanced CSS Stephen Ireland
  • 17. Step Two: Reset Browser Defaults Reset margin and padding on the Unordered List to 0. CSS #navigation ul { margin: 0; padding: 0; } Advanced CSS Stephen Ireland
  • 18. Step Three: Style the <li> Remove the bullet from the list-item and put a coloured border in place. CSS #navigation ul li { list-style: none; border-bottom: 1px solid #b64926; } Advanced CSS Stephen Ireland
  • 19. Step Four: Colour and Block Style the link, display: block; converts the link into a clickable block area. CSS #navigation ul li a:link, #navigation ul li a:visited { display: block; padding: 8px 12px; text-decoration: none; background-color: #8e2800; color: #fff0ab; } Advanced CSS Stephen Ireland
  • 20. Step Five: Hover State Create a roll-over style for the navigation - by changing the background colour of the link. CSS #navigation ul li a:hover { background-color: #468966; } Advanced CSS Stephen Ireland
  • 21. Your Vertical Nav Bar But what if we want it to display horizontally? Advanced CSS Stephen Ireland
  • 22. Horizontal Navigation Remove the contraining width... CSS #navigation { /*width: 200px;*/ font-family: “Lucida Grande”, “Trebuchet MS”, sans-serif; font-size: 80%; font-weight: bold; } Advanced CSS Stephen Ireland
  • 23. Horizontal Navigation Float the list-items left, and change the border to right. CSS #navigation ul li { list-style: none; border-right: 1px solid #b64926; float: left; } Advanced CSS Stephen Ireland
  • 24. Completed Your horizontal navigation Advanced CSS Stephen Ireland