Connecting Tech Pros Worldwide Forums | Help | Site Map

placing text on top of an image with CSS

Newbie
 
Join Date: Sep 2008
Posts: 2
#1: Sep 20 '08
I have code like this. I want "Hello World" to be placed on top of 'big_icon.gif' image which is width: 179 height: 35px. The following code doesn't work with firefox and IE. The image appears, but the image is located below the text.

Does anybody know what is wrong with this code?
Expand|Select|Wrap|Line Numbers
  1. <style>
  2. .header1 {
  3.   background-image:url("images/big_icon.gif");
  4.   background-attachment: fixed;
  5.   background-repeat: no-repeat;
  6.   background-color: #CCCCCC;
  7.   height: 35px;
  8.   margin-top: 0;
  9.   text-align:
  10. }
  11. </style>
  12.  
  13. <div class="header1">Hello World</div>

Expert
 
Join Date: Aug 2008
Posts: 397
#2: Sep 20 '08

re: placing text on top of an image with CSS


Are you attempting to do somethig like this?
hello world!
CSS embedded in head of document (the image is 179 by 35px).
Cursory checked in IE/6, IE/7, and compliant browsers.
HTH
Reply