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 use css to scale images and text to fit on the page

Status
Not open for further replies.

yongbum

Programmer
Dec 15, 2005
48
IL
Hi
I'm using css to position text on a background image and I've arrived at the perfect fit. My problem is when I print
the page is truncated on the right. If I set scaling to 90% in the page setup option everything is (100%) OK. My question is can I use css to scale the whole page to 90% of the original? If so how?
 
You cannot do that, however you can create a separate print stylesheet where you re-limit your website to be 100% (or 90%) wide instead of whatever it is on the screen. I guess you don't want to print the background anyway?
 
Thanks Vragabond,
I've done the stylesheet for printing.
How do I "re-limit your website to be 100% (or 90%) wide"
I do want to print the background image. What I'm actualy printing is a payslip.
So far I've got "font-size: 0.9em;" and that works fine, I've now got 100% of the text on 90% of the background-image, so how do apply 0.9em to the background-image?
 
I have a 2cm border of white space around the image on the printed page? is this area usable for printing if so I don't need to resize, the image will fit on the page.
I've tried "margin: 0; padding: 0" but still have the white border are there any other otions that might that will allow me to print on all the page.
 
Do you have a link where we could examine this? Is your background picture big enough to fit the printed page? If it is, what is limiting you in making your container 100% size (that will be 100% of the paper) instead of whatever it is now. Without the code, it is difficult to advise. In the meanwhile, Geckos (Mozilla, FF) have the ability to scale the whole page -- to fit or to a certain percentage, if you only need this to work on your computer.
 
In response to your last question -- yes, there are options for margins set by the browser. If you tell us which browser you're interested in, we can tell you where to find those options.
 
Thanks Vragabond for pointing me in the right direction
I was using the pixcel size of the image as the width value
(width: 1065) obviously no connection to printing - forgive me I'm new to this. When I used width: 100% everything fell into place.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top