Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I print background image if its disabled in explorer

Status
Not open for further replies.

yongbum

Programmer
Dec 15, 2005
48
IL
Hi I need to print a background with my page (the background is the payslip and the forground is the salary details). The company I'm doing the project for has "print background images and colors" disabled in Explorer and don't want to change it.
How can I print the background in this situation?
I saw a suggestion to create a background layer:
CSS
#bgimg{background-image: url(payslip.gif)}

HTML
<div id="bgimg">
salary details here
</div>

but I could'nt get it to work. Am I doing something wrong?
 
but I could'nt get it to work. Am I doing something wrong?

No, you're not doing anything wrong. If your company has that option disabled in explorer then either:

1. Convince your users to use firefox and enable that option when they print
2. Convince your company to enable the option
3. Just stop worrying about trying to fix it because it's 100% impossible. You cannot adjust a browser's settings like that automatically with css or javascript. Instead of wasting time trying to get it to work, just redo the page so that it doesn't rely on the background image for printing. That's really your only reasonable option, sorry.

-kaht

[small]How spicy would you like your chang sauce? Oh man... I have no idea what's goin' on right now...[/small]
[banghead]
 
thanks kaht for your reply, you say to redo the page - can I put an image on the page and put text ontop as if it was a background - that is I'll be able to see the form behind the text.
 
Maybe if you used position:absolute you could give the image a low z-index to move it below all the text, and position it at 0,0 - but I haven't tested that so I don't know if it would work or not.

-kaht

[small]How spicy would you like your chang sauce? Oh man... I have no idea what's goin' on right now...[/small]
[banghead]
 
kaht's idea of an absolutely positioned picture would work without a problem. Just create a container, give it position relative to define the borders for the picture. Then add img, position it absolutely wherever you want in that container and then start putting the rest of the page in. As long as the elements appear later in the code, you should be ok, but just in case, you can use another div and give an img and the div a z-index, making divs z-index higher. Don't forget to position the inner div relatively as well, since I believe non positioned items do not adhere to z-index.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top