Skip to content

Buzzingz

Unleashing the Power of Code

  • HTML
  • CSS
  • JavaScript
  • Toggle search form

HTML File Paths

Posted on March 4, 2023April 1, 2023 By shani No Comments on HTML File Paths

HTML file paths are used to link external resources such as images, scripts, and CSS files to an HTML document. File paths can be either relative or absolute.

A relative file path specifies the location of a file relative to the location of the current HTML document. For example, if an image file is located in the same directory as the HTML document, the relative file path would simply be the name of the file. If the image file is located in a subdirectory of the current directory, the relative file path would include the name of the subdirectory. If the image file is located in a parent directory, the relative file path would include the “..” notation.

An absolute file path, on the other hand, specifies the complete path to a file from the root directory of the website. Absolute file paths are generally longer and more complex than relative file paths.

Here are some examples of relative file paths:

  • <img src="image.jpg"> (file is located in the same directory as the HTML document)
  • <img src="images/image.jpg"> (file is located in a subdirectory called “images”)
  • <img src="../image.jpg"> (file is located in the parent directory of the HTML document)

And here are some examples of absolute file paths:

  • <img src="/images/image.jpg"> (file is located in a directory called “images” at the root of the website)
  • <script src="https://example.com/js/script.js"></script> (file is located on a different website and is accessed via its URL)
HTML

Post navigation

Previous Post: HTML JavaScript
Next Post: HTML – The Head Element

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

HTML Tutorial

  • HTML History
  • HTML Editors
  • What is an HTML Element?
  • HTML Attributes
  • HTML Headings
  • HTML Paragraphs
  • HTML Styles
  • HTML Text Formatting
  • HTML Quotation and Citation Elements
  • HTML Comments
  • HTML Colors
  • HTML Styles – CSS
  • HTML Links
  • HTML images
  • HTML Favicon
  • HTML Tables
    • HTML Table Colgroup
    • HTML Table Colspan and Rowspan
    • HTML Table Headers
    • HTML Table Padding and Spacing
    • HTML Table Sizes
    • HTML Table Styling
  • HTML List
  • HTML Ordered Lists
  • HTML Unordered List
  • HTML other lists
  • HTML Block and Inline Elements
  • HTML class Attribute
  • HTML id Attribute
  • HTML Iframes
  • HTML JavaScript
  • HTML File Paths
  • HTML – The Head Element
  • HTML Layout Elements and Techniques
  • HTML Responsive Web Design
  • HTML Computer Code Elements
  • HTML Semantic Elements
  • HTML Style Guide
  • HTML Entities
  • HTML Symbols
  • HTML Emojis
  • HTML Encoding (Character Sets)
  • HTML Uniform Resource Locators(URL)
  • HTML Versus XHTML
  • HTML Forms
  • HTML Form Attributes
  • HTML Form Elements
  • HTML Form Target Attribute
  • HTML Input Attributes
  • HTML Input form Attributes
  • HTML Input Types
  • HTML Canvas Graphics
  • HTML SVG Graphics
  • HTML Multimedia
  • HTML Video
  • HTML Audio
  • HTML Plug-ins
  • HTML YouTube Videos
  • HTML Geolocation API
  • HTML Drag and Drop API
  • HTML Web Storage API
  • HTML Web Workers API
  • HTML SSE API
  • About Us
  • Contact Us
  • Privacy Policy
  • Terms & Conditions

Copyright © 2023 Buzzingz.

Powered by PressBook WordPress theme