For some reason beyond me my html page is not finding my stylesheet. I’m using the Django framework if that helps at all. I’m running it on a localhost currently.
Html:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<link rel="stylesheet" href="../fitness/templates/masterpage.css" type="text/css">
</head>
<body>
<h1> MasterPage</h1>
{% block content %} {% endblock %}
</body>
</html>
masterpage.css
h1 {
color: #fff;
}
Thanks guys.
For serving static files, like CSS, django has the staticfiles lib:
https://docs.djangoproject.com/en/dev/howto/static-files/ – development version
https://docs.djangoproject.com/en/1.4/howto/static-files/ – Django 1.4
https://docs.djangoproject.com/en/1.3/howto/static-files/ – Django 1.3
Note that this requires a recent version of Django, as it’s a quite recent addition
My guess is that the URL of the CSS matches no patterns in your urls.py, and thus returns an error