Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97313

Issues linking CSS to HTML

$
0
0

I'm trying to do a simple HTML page using VS Code, but I'm running into issues with the CSS linking to the HTML.

I think my folder structure is good, as I have some images linked in the document further down the line that is being called correctly.

index.html:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="./resources/css/style.css" type="text/css" rel="stylesheet">

resources/css/style.css:

body {
  font-family: Arial, Helvetica, sans-serif;
}

h1 {
  font-size: 100px;
  background-image: url(./resources/images/pattern.jpeg);
  font-weight: bold;
  color: khaki;
}

I've also read on some other threads about making sure to have <meta charset="utf-8"> set and I've also used NotePad++ to make sure the files are encoded correctly. Interestingly when I closed and reopened VS Code to check the encoding, the CSS loaded as I expected, but then wouldn't update any further.

I hope that makes sense, please let me know if I can clarify anything further, and thanks in advance!


Viewing all articles
Browse latest Browse all 97313

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>