Skip to main content
Chemistry LibreTexts

Linking Files and Images

  • Page ID
    185157
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    As stated earlier, the exact address and name of a file can be vitally important when creating websites.  If you don't have the exact location of a file, and if you aren't calling it by it's exact name, bad things happen.

    Things to consider:

    - relative location: Often, we use something called "relative location" when a file is looking for another file.  If you create a link on our index page, and if the link is just called "about.html", then that link will be pointing to a file called about.html in the same folder as the index.  If you move the index, it won't be in the same folder, and the link won't work.  If you move the about.html, then the link won't work anymore either.  You might understand this more as we go on.

    - capitalization: If you have a file called "about.html" but your link is looking for something called "About.html" then the link won't work.  Annoying as heck...  Make sure you're always using lowercase in your file names and folder names, just to be safe and avoid issues.

    - absolute location: This is when you're creating a link like "http://google.com" where you put the http and the whole URL in there.  You can do this for your website, too!  If my "index" and "about" are in the same folder, I can link them to each other with links to "index.html" and "about.html" (which are relative links), or I could use the absolute location "http://mysite.com/index.html" or "http://mysite.com/about.html" to do the same thing.

    Anyway, for this next assignment, you're going to create a folder, put an image in that folder, and link that image.

    Make sure it works before you turn it in! Don't just assume until you've tested it first!

    Objective: Watch the video, create a folder in your "public_html" folder called "images" and add an image to that folder, upload the image to your site, and add the image to your index page.  Post the index (with working image) in the Discussion Board.


    Linking Files and Images is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by LibreTexts.

    • Was this article helpful?