Solved

Why does my content show up outside my background image?

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
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 add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

747 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

10 Experts available now in Live!

Get 1:1 Help Now