Hey this code does not function please help

<!DOCTYPE html>



        <title>Craig M. Dallurs </title>

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




            <div class="main">


                    <li><a href="#">Home</a></li>

                    <li><a href="#">Services</a></li>

                    <li><a href="#">Gallery</a></li>

                    <li><a href="#">About</a></li>

                    <li><a href="#">Contact</a></li>






Preformatted text


    margin: 0;

    padding: 0;

    font-family: Georgia, 'Times New Roman', Times, serif;



    background-color: black;

    height: 100vh;


what doesn’t work exactly?
if the css, check the location of the stylesheet file

I have checked everything

well it does work in codepen.io

what do you expect from the code to do?

I think the problem is with this : href="css/style.css"
try adding ./ before css like that href="./css/style.css", if this doesn’t work, i think the problem is with the path of the file, so try putting the style in the style tags <style>YOUR STYLE GOES HERE</style>

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

i want it to work on a browser not on codepen

it does not function even after adding that

Could you provide more information on what you are trying to do?

What does work on the browser mean?

i want to make the background black for the webpage

Anything that works in codepen will work in a browser.
Just because codepen provides the boilerplate for you doesn’t mean the code will not run in a browser. Once you have good code in codepen you can use the export button to export the code to where you want, all the boilerplate items will be in the exported code.

Is your stylesheet actually in a directory called css? If so, you’re calling it correct provided the name of the file is style.css.

Your code is correct so the issue is that you’re not linking to your CSS file correctly.