Why does my content show up outside my background image?

Attached is a screenshot of a situation that should be cake and ice cream.

All I want is a background image and then put some text over that div. Like so:

<div style="background-image:url(images/custom_divider.png); width:1000px; height:100px;">Bruce's Favorites</b></span></div>

Instead of getting "Bruce's Favorites" within the div, it shows up outside like what you see in teh screenshot.

What am I missing?

brucegustPHP DeveloperAsked:
Who is Participating?
Tom BeckConnect With a Mentor Commented:
Are you sure it's really outside the div? Could it be the text is at the extreme top left corner? Any negative margins involved in the css somewhere?

Also there are some invalid closing </b> and </span> tags inside that div.
brucegustPHP DeveloperAuthor Commented:
You were right, Tom!

I played with it after reading your suggestion and was able to determine it was stuck up in the corner - exactly where it should've been. Gave it a <span> and we were gold!

Tom BeckCommented:
You're welcome. Glad you got it worked out. Thanks for the points.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.