How to create CSS for all website in Visual Studio Code

Hello! I am wondering how to create a file that allows CSS to be the same for all other webpages in Visual Studio Code (: Thanks! (windows unfortunately)

The code (text) Visual Studio accepts isn’t any different from any other text editor that accepts that form of text structure (syntax) and the Windows operating system works just fine. All operating systems have issues, none of them are perfect.

Place all your CSS code within the <style> tag in it’s own document and give that file a .css extension. Then, inside the <head> tag of all the documents you want to use that styling place a <link> to it.

<link type="text/css" rel="stylesheet" href="path/to/your/style.css" />

is the proper syntax in these modern times however you can skip a lot of it and just use:

<link href="path/to/your/stylesheet.css" />

If your css formatting code is in the same directory (folder) as the html files that will be using it <link href="style.css" /> will work.

It’s common practice to name them style.css. We can name them whatever we want. Experienced coders sometimes use multiple style sheets for different elements on the same page so, for example, they’ll use page.css for the overall styling on the page, nav.css for the navigation menu styling, and they might use a separate file for something_else.css so their header section of their html file will look like:

<link href="page.css" />
<link href="nav.css" />
<link href="something_else.css" />

Don’t include the <style> and </style> tags in your .css file. They’re not needed. Place your css code in it without those tags. The reason you don’t see the style tags in code examples often like on codepen and jsfiddle is because they’re intended to be in their own external file.

Question: how will the system know which style.css is which?

It looks through all of the files until it finds the code. For example when <div class="stuff"> an HTTP server knows it needs to look for a css class named .stuff. It looks for it until it finds it in the current document first, then it will look in the linked or included files.

Servers are computers. Computers look through and calculate data in a matter of milliseconds.