I am trying to place 2 Div elements side by side, without luck. I have been following Horizontally stack components and Dash for Beginners! [dash-plotly-python] | by Shraddha Shekhar | Analytics Vidhya | Medium guides on using width<50% and ‘display’: ‘inline-block’ but without luck.
If you look at attached pictures, it looks like the block that is supposed to go to the right, actually does, until i update the page by choosing a song in the list to show the lyrics on the left, then it pushes the recommendations to the bottom. Someone on stackoverflow suggested i change “inline-block” to flex in the parent div, but this forces recommendations block to be to the left, which is almost opposite of what i want.
Any ideas?
My code looks like this:
html.Div([
html.Div(id="lyrics",style={'width': '50%', 'display': 'inline-block'}),
html.Div([
html.H6(id="recommendations",children="Recommendations:"),
html.H3(id="songsbysameartist",children='Songs by the same artist:',
),
html.H6(id="sameartistrecommendations",
),
html.H3(id="songsfromotherartists",children='Music from other artists that you might also like:',
),
html.H6(id="otherartistrecommendations",
)
],
style = {'width': '30%', 'display': 'inline-block'})
])