HTML Basics

HTML Introduction HTML Basic HTML Comments HTML Tags/Elements HTML Attributes HTML Formatting HTML Block and Inline HTML Charsets HTML Classes HTML Colors HTML Div HTML Headings HTML Id HTML Iframes HTML Images HTML File Paths HTML Tables HTML Layout HTML Lists HTML Links <a> HTML Paragraphs HTML Quotations HTML JavaScript HTML Emojis HTML URL Encode HTML Entities HTML Computercode HTML Symbols HTML Styles

HTML Forms

HTML Forms HTML Form Elements HTML Form Attributes HTML Input Attributes HTML Input Regex HTML Input Form Attributes HTML Input Types

HTML SEO

HTML Head HTML Page Title HTML Responsive HTML Semantics HTML Favicon

HTML Graphics

HTML Canvas HTML SVG

HTML Media

HTML Media HTML Audio HTML Video

HTML Reference

a abbr acronym address applet area article aside audio b base basefont bdi bdo big blockquote body br button canvas caption center cite code col colgroup data datalist dd del details dfn dialog dir div dl DOCTYPE dt em embed fieldset figcaption figure font footer form frame frameset h1_-_h6 head header hgroup hr html i iframe img input ins kbd label legend li link main map mark menu meta meter nav noframes noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script search section select small source span strike strong style sub summary sup svg table tbody td template textarea tfoot th thead time title tr track tt u ul var video wbr
HTML File Paths Tutorial

HTML File Paths Tutorial

HTML file paths specify the location of a file within a website structure. There are different types of file paths that you can use depending on the location of the file you want to link to.

Absolute File Paths

An absolute file path specifies the full URL to the file, starting from the root directory of the website. This is typically used when linking to files on external websites or when linking to files in a different domain.

For example, the absolute file path to an image file on an external website might look like this:

<img src="https://www.example.com/images/image.jpg" alt="Image">

Root-Relative File Paths

A root-relative file path specifies the path to a file starting from the root directory of the website. This is useful when linking to files located within the same domain.

For example, the root-relative file path to a stylesheet file in a css directory might look like this:

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

Document-Relative File Paths

A document-relative file path specifies the path to a file starting from the current directory of the webpage. This is useful when linking to files within the same directory or in subdirectories.

For example, the document-relative file path to an image file in an images directory might look like this:

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

Parent Directory File Paths

A parent directory file path specifies the path to a file located in a parent directory of the current directory. This is useful when linking to files in directories above the current directory.

For example, the parent directory file path to a script file in a js directory located one level above the current directory might look like this:

<script src="../js/script.js"></script>