Linking the CSS file to my HTML file doesn't work no matter what I do


Nils

I'm trying to link to CSS files in my HTML index file. It's just one line of code and obviously nothing I try will work. I am using VSCode.

  • If I enter the link from scratch, it also autocompletes (or displays it anyway). So it knows it's there.
  • I also tried moving the CSS files out of the folder and placing them next to the HTML files. But that doesn't work either.
  • I tried styling brackets in the HTML file itself, and the coloring there works.

So the way I test it is that nothing shows up in blue.

I also removed my Javascript from the HTML file into a separate file that I linked to to improve the readability of this question and it did work

Does anyone else have any ideas?

I've also seen other threads for the same issue, but it doesn't show anything new to try.

<!DOCTYPE html>
<html>
<head>
    <title>Calculator</title>
    <meta charset="UTF-8">

    <link rel=”stylesheet” type="text/css" href="styles/style.css">

</head>
<body>
    <a id="stringCalculation"></a><br>
    <a id="stringResult"></a>
    <br>
    <div id="container-numbers">
    <button id="one" class="number">1</button>
    <button id="two" class="number">2</button>
    <button id="three" class="number">3</button>
    <button id="four" class="number">4</button>
    <button id="five" class="number">5</button>
    <button id="six" class="number">6</button>
    <button id="seven" class="number">7</button>
    <button id="eight" class="number">8</button>
    <button id="nine" class="number">9</button>
    <button id="zero" class="number">0</button>
    </div>
    <div id="operators">
    <button id="symbolPlus" class="operator">+</button>
    <button id="symbolMinus" class="operator">-</button>
    <button id="symbolTimes" class="operator">*</button>
    <button id="symbolDivid" class="operator">/</button>
    <button id="equals">=</button>
    </div>
    <div id="other">
    <button id="clearButton">Clear</button><br>
    <button id="backspace">Backsp</button>
    <button id="decimal">.</button>
    </div>

    <script src="javascript/myscript.js"></script>
</body>
</html>

and CSS file:

#one {
    background-color: blue;
}
.number {
    background-color: blue;
}

Here is my folder:

folder structure

in:

folder structure

Ashish Mishra

change this

   <link rel=”stylesheet” type="text/css" href="styles/style.css">

and

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

Related


Linking external CSS file doesn't work

Da_ programmer I'm trying to link my local bootstrap and style files to the html file, but neither of them work. Here is my html file: <!DOCTYPE html> <html> <head> <title>Test page</title> <meta name="viewport" content="width=device-width

Linking external CSS file doesn't work

Da_ programmer I'm trying to link my local bootstrap and style files to the html file, but neither of them work. Here is my html file: <!DOCTYPE html> <html> <head> <title>Test page</title> <meta name="viewport" content="width=device-width

I have tried linking my CSS to my HTML but it doesn't seem to work

David Stazek I am trying to learn HTML and CSS. I have tried using my CSS but it doesn't seem to work. HTML: <head> <link rel="stylesheet" type="text/css" src="styling.css"> <script src="../(public)/js/js.js"></script> <meta charset="utf-8" /> <title>MyPortfol

JavaScript file doesn't work when linking file to html document

Aditya Bavigadda So I have a school project to build a website and am having trouble linking my javascript files correctly. As shown in the code below, the javascript works fine, it's just a reference. I have referenced the javascript file as follows: <scr

JavaScript file doesn't work when linking file to html document

Aditya Bavigadda So I have a school project to build a website and am having trouble linking my javascript files correctly. As shown in the code below, the javascript works fine, it's just a reference. I have referenced the javascript file as follows: <scr

JavaScript file doesn't work when linking file to html document

Aditya Bavigadda So I have a school project to build a website and am having trouble linking my javascript files properly. As shown in the code below, the javascript works fine, it's just a reference. I have referenced the javascript file as follows: <scri

JavaScript file doesn't work when linking file to html document

Aditya Bavigadda So I have a school project to build a website and am having trouble linking my javascript files correctly. As shown in the code below, the javascript works fine, it's just a reference. I have referenced the javascript file as follows: <scr

Matplotlib interactive mode doesn't work no matter what I do

username I am using python 3.7.7 and matplotlib 3.3.1 on Pycharm community 2020.1 I want to draw a graph and let the user decide if he likes the graph by providing some console input. This means I need matplotlib to work in interactive mode. I have tried many

Matplotlib interactive mode doesn't work no matter what I do

username I am using python 3.7.7 and matplotlib 3.3.1 on Pycharm community 2020.1 I want to draw a graph and let the user decide if he likes the graph by providing some console input. This means I need matplotlib to work in interactive mode. I have tried many

Matplotlib interactive mode doesn't work no matter what I do

username I am using python 3.7.7 and matplotlib 3.3.1 on Pycharm community 2020.1 I want to draw a graph and let the user decide if he likes the graph by providing some console input. This means I need matplotlib to work in interactive mode. I have tried many

Matplotlib interactive mode doesn't work no matter what I do

username I am using python 3.7.7 and matplotlib 3.3.1 on Pycharm community 2020.1 I want to draw a graph and let the user decide if he likes the graph by providing some console input. This means I need matplotlib to work in interactive mode. I have tried many

Matplotlib interactive mode doesn't work no matter what I do

username I am using python 3.7.7 and matplotlib 3.3.1 on Pycharm community 2020.1 I want to draw a graph and let the user decide if he likes the graph by providing some console input. This means I need matplotlib to work in interactive mode. I have tried many

linking to local file doesn't work

vkumar I'm trying to build a website and have links to my other pages in the same folder as the website.html file. I put in the correct filename so I can't see where the problem is. I haven't used HTML in a while. Here is the HTML code for the link. When I cli

linking to local file doesn't work

vkumar I'm trying to build a website and have links to my other pages in the same folder as the website.html file. I put in the correct filename so I can't see where the problem is. I haven't used HTML in a while. Here is the HTML code for the link. When I cli

Why doesn't my css file link to my html file?

Encoder 1234 Here is my html code: --------------------------------------- - ------- <!doctype html> <html> <head> <title>My webpage </title> <link rel="stylesheet" type="text/css" href="style.css"/> </head> <body> <h1> My website </h1> <ul> <li> Home</

Why doesn't my css file link to my html file?

Encoder 1234 Here is my html code: --------------------------------------- - ------- <!doctype html> <html> <head> <title>My webpage </title> <link rel="stylesheet" type="text/css" href="style.css"/> </head> <body> <h1> My website </h1> <ul> <li> Home</

jQuery doesn't load in my html file, or it doesn't work

panda I've been creating a simple personal web page and starting with a page that displays a 3x3 image collage in a div where I want the collage to animate and expand its width so I can add a click image , a description of each image on the right. Anyway, I've

jQuery doesn't load in my html file, or it doesn't work

panda I've been creating a kind of simple personal web page and I start with a page that displays a 3x3 image collage in a div where I want the collage to animate and expand its width so I can add a click image , a description of each image on the right. Anywa

External JS file doesn't work in my HTML file

Albert Chantel New to JS, working on D3 visualization, when I serve a html file containing a JS script: <script src="visualization.js" type="text/javascript"></script> I end up with this error message: Failed to load resource: The server responded with a stat