Difficoltà nel caricare un file CSS esterno su una pagina HTML

As a newcomer to the world of HTML and CSS, I am venturing into customizing the 404 error page on Altervista known as not_found.html. This page pulls in styles from an external file named Style.css located within a folder titled Sheets-Style while the page itself sits directly in the root of the Altervista space.

Below is the code I have crafted:

<!DOCTYPE HTML>
<html>
  <head>
    <title>Error - 404</title>
    <link rel="icon" href="Media/Icon.png" type="image/png"/>
    <link rel="stylesheet" type="text/css" href="Sheets-Style/Style.css"/>
    <style type="text/css">
      .container {
        text-align: center;
        border: none;
        margin-top: 10%;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <h1>Oops... Something went wrong.</h1>
      <p>Unfortunately, we couldn't find what you were looking for.
        <br/>
        Try returning to the Home page to see if there's something that interests you.
        <br/>
        Or let us know how we can improve.
        <br/>
      </p>
      <button class="BTN_action" onclick="location.href='index.php'">
        Back to Home
      </button>
      <button class="BTN_action">
        Send Me a Suggestion
      </button>
    </div>
  </body>
</html>

The issue arises when I try opening the page on Chrome, as the css file does not get imported resulting in the absence of the preferred styles. Can anyone pinpoint where I might have made a mistake?

Answer №1

It seems like there may be an issue with the CSS path you're using. Consider trying the following:

<link rel="stylesheet" type="text/css" href="./Styles/Style.css"/>

If this solution doesn't work, please provide more information about the file structure.

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

What could be causing my jQuery function to not correctly update the class as specified?

Presented is a snippet of script that I execute at a specific moment by echoing it in PHP: echo "<script>$('.incorrect-guesses div:nth-child(2)').removeClass('empty-guess').addClass('incorrect-guess').text('2' ...

Safari 10 experiencing issues with overflow and flex combination

I seem to be facing issues with the flex + overflow combination while testing in Safari. For reference, here is the JSFiddle link: https://jsfiddle.net/9dtrr84c/2/ <div class="container-fluid"> <div class="row parent"> <div class="co ...

Using Python and BeautifulSoup to extract the values of a tags nested within multiple other tags

<a href="link" target="_blank" class="xXx text-user topic-author" sl-processed="1"> diamonds </a> My task is to extract the word 'diamonds' from the 'a' tag using BeautifulSoup. Although I have attempted various method ...

Place the image at the center of the div element

I'm having a hard time aligning this image in the center of my divs. No matter what I do, the image ends up either slightly off-center or stuck to the edges of the page. I've experimented with placing it within a row using Bootstrap's grid ...

What could be causing the side margins on my navbar in mobile view in Bootstrap?

After spending some time working on a simple navbar with CSS styling, I encountered an issue when viewing it in mobile mode. The navbar did not expand to 100% of the screen width and had a margin of about 20px on both sides. CSS .navbar .brand { wi ...

Is there a way to have a content's columns adjust to the size of an image?

I'm currently struggling with a layout issue. I have an image on the left and want the content columns on the right (title, lorem...) to adjust their height to match the image. How can I achieve this? I'm using Bootstrap v5.1.1 Current image: ...

Why does the variable in throw new exception print instead of the variable value being printed?

<div style="text-align: left;"> <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>"> Name:<input type="text" name="name"><br> Age:<input type="text" name="age"> <br> ...

What is the best way to adjust the square size using CSS on multiple divs with the same class?

Is it possible to adjust the image size of the second div in CSS while keeping only the square shape intact and using the same class for different divs? <div class="square"> <img class="square__img" src="square.png" ...

Pressing a button triggers the highlighting of a tab in HTML through the use of Javascript

In the corner of my webpage, I have three tabs: info, question, order. When I click on one tab header, only that tab should highlight. The info section includes two buttons that link to the question and order tabs. When these buttons are pressed, the respe ...

Executing a script within a pop-up menu with AJAX

Currently, I have a popup menu that opens and displays text. However, my goal is to attach a controller to the popup menu so that it can perform specific actions. For instance, I would like to create an edit profile popup that includes all the necessary in ...

Exponential calculator in Javascript

I'm working on a basic calculator project using html5, css3 and javascript. However, I've run into an issue with the exponent button not functioning properly. Here's my code snippet: <html> <head> <meta charset = "utf-8" ...

Is it better to apply the font-family to the body or to the html element?

Is it more appropriate to specify the font-family CSS property on the html element or the body element? html { font-family: sans-serif; } or body { font-family: sans-serif; } I've looked into this issue online, but there doesn't seem to ...

The .prepend() method receives the variable returned by ajax and adds it

I'm facing a challenge with adding a dynamic select box to a string within my .prepend() function. The options in the select box are subject to change, so hard coding them is not an option. To tackle this issue, I am using an AJAX call to construct th ...

Revamp selected bootstrap attribute

Imagine a scenario where there is: @media (min-width: 576px) { #projects-edit-middle-column .equal-columns-wrapper .equal-columns { width: 50%; padding-right: 25px; } } This is being utilized within a container: <div class="equal-columns ...

Determine the vertical dimension of an element through a JavaScript event listener

I've been working on creating an Apple-style image sequence scroller from a codepen demo. Here's the link to the original: https://codepen.io/jasprit-singh/pen/LYxzQjB My goal is to modify the JavaScript so that the scroll height is based on a p ...

I am experiencing an issue where the close button image on tap is not closing on the first tap on

Why does the page close on the second tap instead of the first tap when using an iPhone? The image changes on tap but doesn't close as expected. $("#privacy-close-btn").mouseenter(function() { $("#privacy-close-btn").css("display", "none"); $(" ...

Using html and the javascript library 'turn.js' to make an interactive flipbook

I'm trying to use the turn.js library to create a flipbook. Here is the code I have been using, but it doesn't seem to be working correctly for me. It currently works fine on jsfiddle and you can see it here [text]http://jsfiddle.net/xd7sh59p/ W ...

How to make external links open in a new window within wagtail

Recently, I made a change to include target="_blank" in external links by implementing the following code: @hooks.register('after_edit_page') def do_after_page_edit(request, page): if hasattr(page, "body"): soup = BeautifulSoup(page. ...

Dynamic backdrop featuring engaging content

I am currently working on a WordPress website that features a dynamic background. While I have successfully implemented movement to the background, the content on the site remains static and unaffected by scrolling. The background does not move alongside t ...

Troubles encountered when loading pages into a div using ajax navigation

As someone new to the world of programming, I am embarking on the journey of creating a simple website for myself. Currently, my website consists of a header, navigation links, an image below the nav (to be updated later), and 3 content divs beneath that. ...