✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

Replace entire CSS style for HTML DIV

Hi, I have a website which is being displayed on PC and Mobile, They need to have different CSS files for each platform. I tried overriding the default css in /assets/css with another, but it doesnt seem to work. Does anyone know how to do this? thanks

mobile = html.Div(id="modile_override",
children=[
        html.Link(
            rel='stylesheet',
            href='/style_mobile.css'
        ),

   side_panel_layout,
    main_panel_layout,
])


Also, I have DIV with a component who’s style is set to display_none by default, is there some way to override the default styling and set it to display on the page

Hi, I found the solution to this problem,
html.Link(href='/static/style_mobile.css', rel='stylesheet'),

adding the custom css to the /static/ folder seems to store it, and allows it to be referenced by dash. Adding it to /assets/ will automatically add it to every page, and any other folder cannot be referenced