Help with linking a stylesheet with html


#1

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>
<html>

  <head>

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

    <title> Manuel Latouche Portafolio </title>
 
  </head>

  <body

    <h1> Inicio </h1>

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

  </body>
</html>

#2

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.


#3

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


#4

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


#5

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