Chrome is perfectly compatible with links, whereas Firefox seems to have some trouble

Currently working on a school assessment, and one of the requirements is to ensure that the website functions properly in both Chrome and Firefox. While my pages are functional in both browsers, I have encountered an issue with my navigation buttons specifically in Firefox. Upon testing, I receive the error message "protocol (h) is not associated with any program or is not allowed in this context" along with a suggestion to install additional software to open the address.

Below is the code I am using:

<div id="menu">
    <a href="H:/documents/200dts/web_design/scoville_scale/index.html">Home</a>
    <div class="dropdown">
        Content
        <div class="dropdown-content">
            <a href="H:/documents/200dts/web_design/scoville_scale/pages/scoville_scale.html">The Scoville Scale</a>
            <a href="#">Page 2</a>
            <a href="#">Page 3</a>
        </div>
    </div>
    <a href="#">About Us</a>
    <a href="#">Gallery</a>
</div>

Here is the CSS accompanying the aforementioned code:

/* Navigation Bar */
#menu {
    position: fixed;
    top: 0;
    width: 100%;
    color: #ffffff;
    height: 35px;
    text-align: center;
    padding-top: 15px;
    -webkit-box-shadow: 0px 0px 8px 0px #000000;
    -moz-box-shadow: 0px 0px 8px 0px #000000;
    box-shadow: 0px 0px 8px 0px #000000;
    background-color: #2f040c;
}

#menu a {
    font-size: 14px;
    padding-left: 15px;
    padding-right: 15px;
    color: white;
    text-decoration: none; 
}

#menu a:hover {
    color: grey;
} 

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #2f040c;
    min-width: 80px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
}

.dropdown-content a {
    color: grey;
    padding: 16px 18px;
    text-decoration: none;
    display: block;
}

.dropdown:hover .dropdown-content {   
    display: block;
}

Answer №1

To correctly reference the document, you must include file:/// before the path:

href="file:///H:/documents/200dts/web_design/scoville_scale/pages/scoville_scale.html"

For more information, visit the JSFiddle demonstration and read about the File URI Scheme on Wikipedia.

You may also find help from this forum post on support.mozilla.org


The error message regarding non-existent protocol(h) was due to mistaking the drive letter for a type of internet protocol (similar to http, https, and ftp).

Therefore, it interpreted H:/ as a method of accessing data through the internet.

Answer №2

If you want to ensure this page is placed in the index.html directory, follow these steps:

 <a href="index.html">Home</a>
 ....
 <a href="pages/scoville_scale.html">The Scoville Scale</a>

If it is not in the correct directory, make sure to adjust the file paths accordingly:

 <a href="file:///H:/documents/200dts/web_design/scoville_scale/index.html">Home</a>
  ....
 <a href="file:///H:/documents/200dts/web_design/scoville_scale/pages/scoville_scale.html">The Scoville Scale</a>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Solving the default font problem in Laravel

I've been working on a project using Laravel and Bootstrap 4. Recently, I decided to switch from the default Laravel font, Nunito, to Lato. So, I made the necessary changes in my app.css file: @import url(https://fonts.googleapis.com/css?family=Nun ...

Guide on incorporating the WHERE clause into an insert statement in PHP version 5.1.6

What is the correct way to incorporate a where clause into an insert statement in PHP 5.1.6? In my code, I have declared a global variable $module and I am trying to use a where clause to refine my search results. Specifically, I want to include where mod ...

Drag and drop a Jquery image onto the div with its top left corner

Drop targets: <div id="targetContainer" style="width:100px; height:100px;> <div id="tar_0-0" class="target" style="position: relative; float:left; width:50px; height:50px; background-color: #fff;"></div> <div id="tar_1-0" class="t ...

The webpage lacked the functionality of smooth scrolling

I created a website which you can view here. Check out the code below: <div id="mainDiv" class="container"> <div id="header"> <div class="plc"> <h1><a href="#"></a></h1> ...

Regularly changing the text shown in an HTML element and halting when the content array is exhausted

I have a strong desire to develop my own speed reading software. To achieve this goal, I am in need of text that changes continuously and stops once the passage is completed. I attempted storing the contents in an array and managed to make the text change ...

Tips for modifying the color of highlighted text?

Can you help me change the color of this text from blue to dark green by using Javascript or HTML/CSS? Please left-click and drag over the text to select it. ...

Tips for aligning the navigation bar in the center

I recently came across a simple tutorial on w3schools (article) for creating a responsive menu. However, I've been struggling to center it horizontally for the past few days. Here is the HTML code: <ul class="topnav"> <li><a href=" ...

It is impossible to retrieve $_POST[] values from a form with the class of "contact-form."

I've been puzzled by the fact that $_POST wasn't capturing any input fields in my HTML contact form. After hours of troubleshooting, I finally figured out that the issue stemmed from my form having a class of "contact-form" For example, this me ...

Unique CSS-created chronological schedule with alternating design

I am looking to customize my CSS timeline by removing the first line and changing the color of each individual circle. How can I achieve both of these modifications? I attempted to add a class called .not_complete to one of the timeline containers, but it ...

Tips for dragging and dropping a file attachment directly into your web browser

Google has recently introduced this feature to Gmail, and it doesn't need you to download any additional plugins. This feature is compatible with both Firefox and Chrome browsers, but unfortunately not with Internet Explorer. ...

How can I make a div move to the position of another div and stay with it when the screen is resized?

In my card game project, I am dealing with an issue where cards are not aligning properly with the designated "dropZonePositions" when the screen is resized. Despite creating animations for the card movement that I'm satisfied with, the problem arises ...

Dynamic menu bar accompanied by primary content

I'm facing an issue with my active navigation bar. Whenever I open the hamburger menu, the main content remains fixed and does not move along with the open navigation menu. I tried searching online for a solution but couldn't find anything helpfu ...

Select interest groups with Mailchimp ahead of time

My current project involves utilizing Mailchimp to integrate a subscribe form onto my website, which includes nearly 40 interest groups as checkboxes. To showcase the form in a popup upon clicking, I have implemented jQuery Modal for this purpose. Howeve ...

Unable to display image on HTML due to the image src not loading

Hey folks! I'm currently working on a TodoApp using react js, and although I have a basic layout set up, I am encountering an issue while trying to add images to the app. Unfortunately, the images are not loading as expected. Sharing the relevant cod ...

Conceal button in PHP

Is there a way to remove the background of this button? 1 <-- VIEW BACKGROUND IMAGE <button type="submit" name="submit" value="submit"><img src="https://cdn.discordapp.com/attachments/653356422083379252/654012639847907328/download-button-png- ...

Pagination in PHP for generating PDF files

Currently, I am utilizing the dompdf HTML to PDF converter for dynamically generating PDF files based on specific variables. The approach involves creating a PHP file with a script and then extracting information from that PHP file to trigger the download ...

Tips for utilizing divs and spans in HTML5

When it comes to web development, HTML markup is utilized for structuring content, while CSS is used for styling and presenting that content. In the past, HTML elements like <div> were often assigned semantic meaning through the use of IDs and class ...

What is the proper way to reference a background image in CSS?

As I work on designing my webpage, I am looking to add a Blur filter to the body background-image. To achieve this, is it possible to reference the background-image property? ...

css A fixed-width image with a height that adjusts automatically

My dilemma is with a fixed div that has CSS property width: 400px; height: 280px;. The images I am dealing with come in different dimensions, some are portrait and some are landscape. How can I adjust my image to fit/stretch/fill the div size regardless ...

It appears that the source code of the website is pointing to a separate CSS stylesheet

I have transferred all my HTML pages, CSS, and supporting files to Bluehost. While everything works fine locally, there seems to be an issue once it's on the server. The CSS file, located in the same directory as index.html, uploads successfully to th ...