Remove scrollbar from folium map in Python

Juan C :

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)

enter image description here

But this creates a scrollbar, which makes navigating a bit uncomfortable. Before adding the title I had no problems, as you can see:

enter image description here

So, is there any way to add a title without adding a scrollbar?

Thanks!

Barbaros Özhan :

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>
     ''' 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=390361&siteId=1