Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Flask Basics Templates and Static Files Static Files

William Watlington
William Watlington
3,347 Points

styles.css doesn't seem to be working?

I seem to have correctly followed the instructions in this video but can't get the colors from styles.css to work

Here's styles.css from my workspace

body {
  background: beige;
  color: mediumorchid
}

and here's layout.html

<!doctype html>
<html>
  <head>
    <title>{% block title %}Flask Basics{% endblock %}</title>
    <link rel="stylesheet" href"/static/styles.css">
  </head>
  <body>
    {% block content %}{% endblock %}
    <p>Brought to you by the fine folks at Treehouse</p>
    {% block scripts %}{% endblock %}

  </body>
</html>

1 Answer

Billy Bellchambers
Billy Bellchambers
21,689 Points

Might want to check the location of your ccs file in your <link>

Looks like you have an extra "/" at the begining of the href.

Maybe should be.

<!doctype html>
<html>
  <head>
    <title>{% block title %}Flask Basics{% endblock %}</title>
    <link rel="stylesheet" href="static/styles.css">
  </head>
  <body>
    {% block content %}{% endblock %}
    <p>Brought to you by the fine folks at Treehouse</p>
    {% block scripts %}{% endblock %}

  </body>
</html>

Hope that helps.

Happy coding

Billy Bellchambers
Billy Bellchambers
21,689 Points

just spotted as well that the "=" is missing for href ill amend that into my orginal post.

William Watlington
William Watlington
3,347 Points

Thanks! Don't know how I stared at it that long and missed that!