I am trying to put a image in the background in a div but it does not work. Here is my code :
<div
style='background: url("https://images.unsplash.com/photo-1426604966848-d7adac402bff?ixid=MnwxMjA3fDB8MHxzZWFyY2h8OXx8bmF0dXJlfGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=500&q=60")'
className="h-52 sm:h-full sm:w-72 rounded-xl bg-gray-100 bg-center bg-cover"
></div>
Pycharm told me XML tag has empty body because I have nothing between the div tag but I just want to display a image from unsplash ...
Could you help me please ?
Thank you very much !
<div style="..." className="..." />styleprop expects a mapping from style properties to values, not a string. For example,style={{marginRight: spacing + 'em'}}when using JSX."