0

Hey guys I already know that this is easy but I have tried everything I can think of and cant figure it out. I cannot get my style sheet to work on my html both are saved in the folder website1. inside that there are 2 folders css and index with the files saved in the respective folder. not mind either of my coding these are not my website just a very small example I am sending to find help.

<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Untitled Document</title>
    <link rel="stylesheet" type="text/css" href="css/style.css">

</head>
<body>
<div class="container">
`<div class="row">
<div class="col-xs-6">
    <button class="btn btn-default btn-xl">About</button>
    <button class="btn btn-default btn-xl">Portfolio</button>
    <button class="btn btn-default btn-xl">Contact</button></button>



    </a>
    </div>
</div>
</div>


</body>
</html>

My css page looks like this

body{
color: blue;
}

button{
color: aliceblue;
}
brad65340
  • 1
  • 1
  • If the index.html file is inside of it's own folder like you said, you will need to append ../ before the css/style.css URL. That way your page can go up one folder out of the index folder and into the css folder. – Blacky Wolf Nov 15 '16 at 03:40
  • 1
    Possible duplicate of [How to go up a level in the src path of a URL in HTML?](http://stackoverflow.com/questions/4810927/how-to-go-up-a-level-in-the-src-path-of-a-url-in-html) –  Nov 15 '16 at 03:40
  • add your folder structure. – AVI Nov 15 '16 at 04:01

1 Answers1

1

If your html file is in the index subfolder, and css is in the css subfolder, then you should reference it like:

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

Hope this helps :)

flauntster
  • 2,008
  • 13
  • 20