Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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!