title: Python Dash: Custom CSS
body: <p>I want to feed a CSS stylesheet or a <code>&lt;style&gt;</code> block into a Python Dash app. I've attempted to do both below, but neither works for me. The app loads fine, but the text remains black, not green.</p>
  
  
  
  <pre><code>import dash
  
  from dash.dependencies import Input, Output
  import dash_core_components as dcc
  import dash_html_components as html
  import plotly.graph_objs as go
  from flask import send_from_directory
  
  
  
  # define the app
  app = dash.Dash()
  
  app.head = [html.Link(rel='stylesheet', href='./static/stylesheet.css'),
      ('''
      &lt;style type="text/css"&gt;
      h1 {
          color:green;
      }
      &lt;/style&gt;
      ''')]
  
  app.layout = html.Div(html.H1('Hello World!'))
  
  
  if __name__ == '__main__':
      app.run_server(debug=True)
  </code></pre>
  
  <p>and inside <code>./static/stylesheet.css</code> is a file with only this:</p>
  
  
  
  <pre><code>h1{
    color:green;
  }
  </code></pre>
  
  <p>I've tried having just the stylesheet or just the <code>&lt;style&gt;</code> tag but neither of those turns the h1 tag green either.</p>
  
  <p>Here is the research I've done to try to solve my issue:</p>
  
  <p><a href="https://github.com/plotly/dash/pull/171" rel="noreferrer">https://github.com/plotly/dash/pull/171</a></p>
  
  <p><a href="https://dash.plot.ly/external-resources" rel="noreferrer">https://dash.plot.ly/external-resources</a></p>
  
  <p><a href="https://github.com/plotly/dash-recipes/blob/master/dash-local-css-link.py" rel="noreferrer">https://github.com/plotly/dash-recipes/blob/master/dash-local-css-link.py</a></p>
  
  <p>The only thing I haven't tried (that those links suggest) is to load from an external link (CDN). However I want to be able to load this app offline so that isn't an option.</p>