🚀 Gen 5 of the leading AI app deployment platform launches October 6. Click for the livestream.

Having Trouble with External CSS

I’m trying to load an external css file but every time I update my Dash, the css doesn’t load.


import pandas as pd
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.express as px
import plotly.graph_objects as go

external_stylesheets = [‘https://codepen.io/AnthonyNicholasGray/pen/mdmXWge.css’]

app = dash.Dash(name, external_stylesheets=external_stylesheets)

df = pd.read_csv(“pfsites.csv”, sep = “,”)

fig = px.pie(df, values=“System Size (kW)”, names = “Location”)

scat_map = px.scatter_geo(df, lat=“Latitude”, lon=“Longitude”,
hover_name=“Location”,
projection=“albers usa”)

app.layout = html.Div(children=[
# All elements from the top of the page
html.Div([
html.H1(children=‘Our Solar Panel Projects’),

    html.Div(children='''
        Welcome!
    '''),

    dcc.Graph(
        id='bar',
        figure=fig
    ),  
]
         ),


html.Div([
    html.H1(children='Map'),

    html.Div(children='''
        Our USA Project.
    '''),

    dcc.Graph(
        id='map',
        figure=scat_map
    ),  
]),

],
)

if name == ‘main’:
app.run_server(debug=True)


Was this affected by the new update?

Hi @Anthony1 and welcome to the Dash Community !

If I goes to your css file link I receive this message:
image

It should be receiving something like this:

Thank you Eduardo! What url should I be using for code pen? When I open the code pen file, I copied that url.

Sorry, I have no idea :woozy_face:

:’(

It’s all good, thank you for trying out that link. I’m going to play around with this a little more

1 Like