×
1 Choose EITC/EITCA Certificates
2 Learn and take online exams
3 Get your IT skills certified

Confirm your IT skills and competencies under the European IT Certification framework from anywhere in the world fully online.

EITCA Academy

Digital skills attestation standard by the European IT Certification Institute aiming to support Digital Society development

LOG IN TO YOUR ACCOUNT

CREATE AN ACCOUNT FORGOT YOUR PASSWORD?

FORGOT YOUR PASSWORD?

AAH, WAIT, I REMEMBER NOW!

CREATE AN ACCOUNT

ALREADY HAVE AN ACCOUNT?
EUROPEAN INFORMATION TECHNOLOGIES CERTIFICATION ACADEMY - ATTESTING YOUR PROFESSIONAL DIGITAL SKILLS
  • SIGN UP
  • LOGIN
  • INFO

EITCA Academy

EITCA Academy

The European Information Technologies Certification Institute - EITCI ASBL

Certification Provider

EITCI Institute ASBL

Brussels, European Union

Governing European IT Certification (EITC) framework in support of the IT professionalism and Digital Society

  • CERTIFICATES
    • EITCA ACADEMIES
      • EITCA ACADEMIES CATALOGUE<
      • EITCA/CG COMPUTER GRAPHICS
      • EITCA/IS INFORMATION SECURITY
      • EITCA/BI BUSINESS INFORMATION
      • EITCA/KC KEY COMPETENCIES
      • EITCA/EG E-GOVERNMENT
      • EITCA/WD WEB DEVELOPMENT
      • EITCA/AI ARTIFICIAL INTELLIGENCE
    • EITC CERTIFICATES
      • EITC CERTIFICATES CATALOGUE<
      • COMPUTER GRAPHICS CERTIFICATES
      • WEB DESIGN CERTIFICATES
      • 3D DESIGN CERTIFICATES
      • OFFICE IT CERTIFICATES
      • BITCOIN BLOCKCHAIN CERTIFICATE
      • WORDPRESS CERTIFICATE
      • CLOUD PLATFORM CERTIFICATENEW
    • EITC CERTIFICATES
      • INTERNET CERTIFICATES
      • CRYPTOGRAPHY CERTIFICATES
      • BUSINESS IT CERTIFICATES
      • TELEWORK CERTIFICATES
      • PROGRAMMING CERTIFICATES
      • DIGITAL PORTRAIT CERTIFICATE
      • WEB DEVELOPMENT CERTIFICATES
      • DEEP LEARNING CERTIFICATESNEW
    • CERTIFICATES FOR
      • EU PUBLIC ADMINISTRATION
      • TEACHERS AND EDUCATORS
      • IT SECURITY PROFESSIONALS
      • GRAPHICS DESIGNERS & ARTISTS
      • BUSINESSMEN AND MANAGERS
      • BLOCKCHAIN DEVELOPERS
      • WEB DEVELOPERS
      • CLOUD AI EXPERTSNEW
  • FEATURED
  • SUBSIDY
  • HOW IT WORKS
  •   IT ID
  • ABOUT
  • CONTACT
  • MY ORDER
    Your current order is empty.
EITCIINSTITUTE
CERTIFIED

What are the two types of links used in HTML and CSS for linking files and navigating through directories?

by EITCA Academy / Monday, 07 August 2023 / Published in Web Development, EITC/WD/HCF HTML and CSS Fundamentals, Further advancing in HTML and CSS, File paths in HTML and CSS, Examination review

In HTML and CSS, there are two types of links that are commonly used for linking files and navigating through directories: relative links and absolute links.

1. Relative Links:
Relative links are used to link files within the same directory or in a subdirectory of the current directory. They are specified using a relative path, which is a path relative to the current location of the file. Relative links are convenient when you want to link files within your project without specifying the entire URL.

There are two types of relative links: relative file paths and relative directory paths.

a. Relative File Paths:
A relative file path specifies the location of a file relative to the current file. It is used when you want to link to a specific file within the same directory or in a subdirectory. The relative file path is specified by simply specifying the file name or the path to the file from the current file.

For example, if you have an HTML file called "index.html" and you want to link to a CSS file called "styles.css" in the same directory, you can use the following relative file path:

<link rel="stylesheet" href="styles.css">

If the CSS file is located in a subdirectory called "css", you can use the following relative file path:

<link rel="stylesheet" href="css/styles.css">

b. Relative Directory Paths:
A relative directory path specifies the location of a file relative to the current directory. It is used when you want to link to a file in a different directory than the current file. The relative directory path is specified by using "../" to indicate moving up one directory level, and then specifying the path to the file from there.

For example, if you have an HTML file called "index.html" in the root directory, and you want to link to an image file called "image.jpg" in a subdirectory called "images", you can use the following relative directory path:

<img src="../images/image.jpg">

The "../" moves up one directory level from the current file (index.html), and then the path "images/image.jpg" specifies the location of the image file.

2. Absolute Links:
Absolute links are used to link files by specifying the complete URL or file path. They are not relative to the current file or directory. Absolute links are useful when you want to link to a file on a different website or specify an exact file path.

Absolute links can be specified in two ways: absolute URLs and absolute file paths.

a. Absolute URLs:
An absolute URL specifies the complete web address of a file, including the protocol (http or https), domain name, and file path. It is used when you want to link to a file on a different website.

For example, to link to a CSS file hosted on a different website, you can use the following absolute URL:

<link rel="stylesheet" href="https://example.com/styles.css">

b. Absolute File Paths:
An absolute file path specifies the complete file path of a file on the local system. It is used when you want to link to a file on your computer or specify an exact file path.

For example, to link to an image file located at "C:imagesimage.jpg" on a Windows system, you can use the following absolute file path:

<img src="file:///C:/images/image.jpg">

The "file:///" indicates that it is an absolute file path, and then the path "C:/images/image.jpg" specifies the location of the image file.

Relative links and absolute links are the two types of links used in HTML and CSS for linking files and navigating through directories. Relative links are used to link files within the same directory or in a subdirectory, while absolute links are used to link files by specifying the complete URL or file path. Understanding the differences and appropriate usage of these link types is essential for effective file linking and directory navigation in web development.

Other recent questions and answers regarding Examination review:

  • Why is it not recommended to use a forward slash at the beginning of a file path to go back to the main directory of a website?
  • What is the purpose of ".." followed by a forward slash in a file path?
  • How do you specify the path for a URL path to link to an external website?
  • How do you specify the path for an internal link to a file within the same website?

More questions and answers:

  • Field: Web Development
  • Programme: EITC/WD/HCF HTML and CSS Fundamentals (go to the certification programme)
  • Lesson: Further advancing in HTML and CSS (go to related lesson)
  • Topic: File paths in HTML and CSS (go to related topic)
  • Examination review
Tagged under: Absolute Links, CSS, File Paths, HTML, Links, Relative Links, Web Development
Home » Web Development » EITC/WD/HCF HTML and CSS Fundamentals » Further advancing in HTML and CSS » File paths in HTML and CSS » Examination review » » What are the two types of links used in HTML and CSS for linking files and navigating through directories?

Certification Center

USER MENU

  • My Account

CERTIFICATE CATEGORY

  • EITC Certification (105)
  • EITCA Certification (9)

What are you looking for?

  • Introduction
  • How it works?
  • EITCA Academies
  • EITCI DSJC Subsidy
  • Full EITC catalogue
  • Your order
  • Featured
  •   IT ID
  • EITCA reviews (Medium publ.)
  • About
  • Contact

EITCA Academy is a part of the European IT Certification framework

The European IT Certification framework has been established in 2008 as a Europe based and vendor independent standard in widely accessible online certification of digital skills and competencies in many areas of professional digital specializations. The EITC framework is governed by the European IT Certification Institute (EITCI), a non-profit certification authority supporting information society growth and bridging the digital skills gap in the EU.
Eligibility for EITCA Academy 90% EITCI DSJC Subsidy support
90% of EITCA Academy fees subsidized in enrolment

    EITCA Academy Secretary Office

    European IT Certification Institute ASBL
    Brussels, Belgium, European Union

    EITC / EITCA Certification Framework Operator
    Governing European IT Certification Standard
    Access contact form or call +32 25887351

    Follow EITCI on X
    Visit EITCA Academy on Facebook
    Engage with EITCA Academy on LinkedIn
    Check out EITCI and EITCA videos on YouTube

    Funded by the European Union

    Funded by the European Regional Development Fund (ERDF) and the European Social Fund (ESF) in series of projects since 2007, currently governed by the European IT Certification Institute (EITCI) since 2008

    Information Security Policy | DSRRM and GDPR Policy | Data Protection Policy | Record of Processing Activities | HSE Policy | Anti-Corruption Policy | Modern Slavery Policy

    Automatically translate to your language

    Terms and Conditions | Privacy Policy
    EITCA Academy
    • EITCA Academy on social media
    EITCA Academy


    © 2008-2026  European IT Certification Institute
    Brussels, Belgium, European Union

    TOP
    CHAT WITH SUPPORT
    Do you have any questions?
    We will reply here and by email. Your conversation is tracked with a support token.