How to get my CSS file to show on github website

Hello, I have made a file in Visual Studio Code named pathtoyourstylesheet.css. See below. But, the style is still not showing on my github. It DOES however show when I do f5 in visual studio code. Any reason why? Thanks (:

< link rel=“stylesheet” href=“pathtoyourstylesheet.css”>

As far as I know It should be written like this:

<link rel = "stylesheet" href="pathtoyourstylesheet.css">

Just close the link tag with an arrow in the beginning.

< at the beginning. Without it that whole line is just text, an http engine will print it (display it on the page) instead of generating and reading it as code.

I see you used my other example in your other thread. We can name our .css files anything we want. I’m hoping you understand me writing path/to/your/stylesheet.css was an example to reference writing a path to a file. I wasn’t suggesting you name the file “path/to/your/stylesheet.css”.

The / character tells an http engine to go forward a directory. Sometimes experienced coders place all of their .css files in a folder named “styles” to keep things organized. So to link to a css file that’s in the folder named “styles” the path to it would be written as styles/style.css

<link href="styles/style.css">

The above links the .css file named “style.css” that’s stored in a folder named “styles”

if the css file was in subfolders like codefiles > layoutstuff > css > styles and the css file was named “layout.css” the link path would be:
<link href="codefiles/layoutstuff/css/styles/layout.css">

Ah! The problem was I made a new file and named it pathtoyourstylesheet, but I don’t know how to format it I guess to get it to show on the web :stuck_out_tongue: I’m a noob

I hate to say it, but I guess I just don’t have the slightest clue on what I’m doing. Nowhere in any of these modules does it show how to do this I don’t think. gaaaah lol

The courses on this site are a great place to start for someone that wants to learn how to create websites by hard coding them, which in my opinion is the best way to create them vs using a cookie cutter package that makes having a website easy like Wordpress. Using a Content Management System (CMS) like Wordpress doesn’t teach a person how to write code and create a custom website from nothing.

You’re not going to be an expert at it tomorrow. Too many people assume this stuff is something they can learn and be good at quickly, it’s a mistake to think that. The courses on this site are something that provides leaps instead of baby steps toward a persons goals if their goal is learning how to build custom websites.

I learned most of what I know from books and hobbying at it as a pass time interest for over 2 decades now and I’m still learning new things every day. It’s possible to get pretty good pretty quickly, over a few months of staying at it, it’s not possible to ever know everything. We’re always going to make mistakes. Making mistakes is a good thing because we learn from them.

1 Like

The only difference in the formatting between using CSS in-line, which means in the same file as the rest of the code, and using css in an external file is linking the file.

When we place the css in the same file (in-line) we put it inside the <style> tag like this:

<html>
<head>
<style>
tag {
  css-property: value;
}

anothertag {css-property: value;}

.class {
  css-property: value;
  css-property: value;
  css-property: value;

.anotherclass {css-property: value;css-property: value;css-property:value;}
</style>
</head>

When we create an external .css file the <style> tag is not included:

tag {
css-property: value;
}

anothertag {css-property: value;}

.class {
  css-property: value;
  css-property: value;
  css-property: value;
}
.anotherclass {css-property: value;css-property: value;css-property:value;}

We save the file formatted like that as whateverwewant.css then in our html file we link it:

<html><head>
<link type="text/css" rel="stylesheet" href="whateverwewant.css" />
</head>
<body>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.