Reputation: 6132
I recently started working with folium
which is a bit web developer oriented and I'm not. So I created a map and injected a title onto it, like this:
m = folium.Map(location=loc,
center=center, zoom_start=13)
title_html = '''
<h3 align="center" style="font-size:20px"><b>Titly title</b></h3>
'''
m.get_root().html.add_child(folium.Element(title_html))
display(m)
But this creates a scrollbar, which makes navigating a bit uncomfortable. Before adding the title I had no problems, as you can see:
So, is there any way to add a title without adding a scrollbar?
Thanks!
Upvotes: 3
Views: 1315
Reputation: 65288
It's related to the html's style
properties which is mostly stated between the <head></head>
tags. So yo can convert the variable title_html
as below :
title_html = '''
<head><style> html { overflow-y: hidden; } </style></head>
<h3 align="center" style="font-size:20px"><b>Titly title</b></h3>
'''
Upvotes: 2