Solved

Why does my content show up outside my background image?

Posted on 2015-02-24
3
72 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now