I am having an issue linking my CSS to HTML on my computer. My html file has the correct link and name for the CSS file but when I open by HTML file in chrome there is no styling. If I open up dev tools after that and go to source, only my js and html file show in the folder even though there is json, css, html, and js file in the project folder. The CSS file name is index.css, the js file name is index.js, and the html file name is index.html. If you know what could be wrong please let me know. I ran both files here and they work here but not when I try and run my html file on chrome.
CODE:
body {
margin: 0;
padding: 10px;
font-family: Arial, Helvetica, sans-serif;
min-width: 400px;
}
input {
width: 100%;
padding: 10px;
box-sizing: border-box;
border: 1px solid #5f9341;
margin-bottom: 4px;
}
button {
background: #5f9341;
color: white;
padding: 10px 20px;
border: 1px solid #5f9341;
font-weight: bold;
}
#delete-btn {
background: white;
color: #5f9341;
}
ul {
margin-top: 20px;
list-style: none;
padding-left: 0;
}
li {
margin-top: 5px;
}
a {
color: #5f9341;
}
<!DOCTYPE html>
<html lang="en">
<head>
<link src="index.css" ref="stylesheet" type: "text/css">
</head>`enter code here`
<body>
<input type="text" id="input-el">
<button id="input-btn">SAVE INPUT</button>
<button id="tab-btn">SAVE TAB</button>
<button id="delete-btn">DELETE</button>
<ul id="ul-el">
</ul>
<script src="index.js"></script>
</body>
</html>
CodePudding user response:
Instead of "src" it needs to be "href", and "type:" must be "type="
<link href="index.css" rel="stylesheet" type="text/css">