Hi all
I am having problems with my dash app. I use bootstrap components dbc.Row dbc.Col for managing the layout and a dbc.SimpleNavBar. The problem ist that when calling the local host with internet explorer the layout and the Navbar works fine, the content however is cut at the edge of my webbrowser. When using Chrome, the bootstrap components do not work. The Navbar is displayed in an odd way and the dbc.Cols are not recognized. Did anybody experienced similiar problems? I assume that this is a browser setting issue?
Thanks for any feedback
Iâm not aware of any browser setting that needs to be doneâŚI use dash-bootstrap-compents for my app and there are no issues in IE, Chrome, FirefoxâŚ
Based on your post alone, do you have the following in your code - specifically the external_stylesheets
reference?
app = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])
Yes, have the correct stylesheet included. Itâs really strange. It must be dealing with some internal company restrictions/settings. I will let you know once I found a solution or explanation.
Hi @flyingcujo and others
Ok, so my Chrome somehow blocked the css file linked by dbc.themes.BOOTSTRAP
âhttps://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.cssâ
I donwloaded the file and put it in my assets folder. However, this was not enough. I had to explicitly specify the folder when creating the app:
app = dash.Dash(__ name__ ,external_stylesheets=[â\assets\bootstrap.cssâ])
Now all works fine.
Best regards
You shouldnât have needed to specify the assets
folder. However, in your last post you indicated the folder was asset
vice assets
.
ah sorry, that was a typo. folder Name assets\
okâŚjust double-checkingâŚodd that you need to specify the path.
1 Like
I couldnât get dbc.themes.FLATLY to work (Firefox) so am just using the full https path:
external_stylesheets = [âhttps://stackpath.bootstrapcdn.com/bootswatch/4.4.1/flatly/bootstrap.min.cssâ]
are there any further requirements weâre missing?
import dash_bootstrap_components as dbc
external_stylesheets = [âdbc.themes.FLATLYâ]
app = dash.Dash(name, external_stylesheets=external_stylesheets)
app.layoutâŚetc.
does it work when using the full path instead of dbc.themes.FLATLY? Did you check the themes.py file in the lib folder?
dbc.themes.FLATLY
shouldnât be in quotes. Other than that, youâre implementing it the same way I am; except I am using dbc.themes.BOOTSTRAP
Thank you both. I actually just caught on to the quotes issue when Madison01 pointed to the actual themes.py file. BTW it is working now that the quotes are removed.
Awesome! Glad itâs working.
Great, we learned something