Help with linking a stylesheet with html

I finish a couple of lessons from the learn html and css curse so I want it to try to practica what i’ve learn. I began doing the code for a little page but I can´t link the stylesheet to the html no matter what I do. Please tell what i´m doing wrong.

<!DOCTYPE html>


    <link rel="stylesheet" type="text/css" href="C:\Users\pc\Documents\pagina-web\stylesheet.css">

    <title> Manuel Latouche Portafolio </title>


    <h1> Inicio </h1>

    <img src="C:\Users\pc\Desktop\post instituto\imagen-de-portafolio-2.jpg"/>


Okay, put everything in the same folder (for example, pagina-web).

So inside of pagina-web, you’ll have

  • index.html
  • stylesheet.css

Then your link becomes

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

because both files are located in the same folder.

If your root folder was pagina-web, and inside you had a css folder, then the link would be

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

You can do the same thing with images by the way.

It work! Thanks! I needed the help :slight_smile:

1 Like

But using an absolute path must be possible? I mean, yea, agree, i would use relative paths as well, but still

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