0

enter image description here

I have stored the image URL in cover_url variable.

When I display the image using the variable, its broken but when I paste directly the URL, it works!

What am I doing wrong here?

1 Answer 1

1

You forgot to add the quotes for the html to know that the src attribute is a string. This the output when you print the variable.

<center><img src=https://i.scdn.io/... /></center>

This way, what comes after your src attribute isn't considered as a string. The solution in your case would be just by adding the quotes symbol.

<center><img src="{cover_url}" /></center>

Hope this was helpful.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.