Reputation: 1
This is my html:
<!DOCTYPE html>
<html>
<head>
<title> </title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="bootstrap" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body background="bgroundpic.jpg">
<div id="top" style="background-color: #F6F6F6"
<h1> This is a website</h1>
</div>
</body>
</html>
This is my CSS:
html {
background: bgroundpic.jpg no-repeat center center fixed;
height: 100%;
width: 100%;
}
body {
font-family: 'Noto Sans', sans-serif;
margin: 0 auto;
height: 100%;
width: 100%;
background-color: blue
}
h1 {
text-align: centre;
vertical-align: middle;
line-height: 90px;
color: green;
}
.top{
height: 70%;
position
}
My css is called style.css
and it is in a sub-folder named css
Upvotes: 0
Views: 81
Reputation: 6780
You answered it yourself, saying your css file lives inside a css directory.
So the path to that file should be:
<link rel="stylesheet" type="text/css" href="css/style.css">
Upvotes: 4
Reputation: 7025
Tryusing ~
or /
or ../
<link rel="stylesheet" type="text/css" href="/style.css">
or
<link rel="stylesheet" type="text/css" href="~/style.css">
or
<link rel="stylesheet" type="text/css" href="../style.css">
Upvotes: 0