Solved

Why does my content show up outside my background image?

Posted on 2015-02-24
3
86 Views
Last Modified: 2015-02-25
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?

screenshot
0
Comment
Question by:brucegust
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 38

Accepted Solution

by:
Tom Beck earned 500 total points
ID: 40629037
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.
0
 

Author Comment

by:brucegust
ID: 40629430
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!

Thanks!
0
 
LVL 38

Expert Comment

by:Tom Beck
ID: 40630373
You're welcome. Glad you got it worked out. Thanks for the points.
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question