Solved

Why does my content show up outside my background image?

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why "Mobile First"? 5 63
Effective CSS style applied to an element 5 47
CSS DIV Height in Percent 1 40
center div inside another div 2 32
CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
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 elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

752 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