Click to See Complete Forum and Search --> : How to print the CSS?


fisher999
06-05-2006, 11:55 AM
hello, I am a beginner of the css and i find the web page cannot print completely even in print preview. I know can add the print stylesheet to slove this problem. But I tried many times still can solve it. Can u teach and suggest the way to me?

student :(

nataliemac
06-05-2006, 01:04 PM
Create a separate style sheet that lays out your page for printing. When you attach the sheet in the head of your document use media="print" in the <link> tag.

fisher999
06-05-2006, 01:08 PM
yes, i tried it before. but i dont know how to make the write the print style css. Like how to remove the image just show the text when printout.

DaveSW
06-05-2006, 01:12 PM
Your print stylesheet depends entirely upon your coding.
Can you link to your site?

fisher999
06-05-2006, 01:20 PM
see the attach files. Please teach me how to slove it because I tried many times.... :confused:

Student

fisher999
06-05-2006, 01:37 PM
is it difficult to solve? how to solve it?

nataliemac
06-05-2006, 02:10 PM
Can you please post either a link to your code or else paste your code into your post? I don't think you'll find many people here willing to download your .zip file.

fisher999
06-05-2006, 10:59 PM
Please help! I already tried but not work, anyone can suggest some ways to me?

nataliemac
06-06-2006, 01:03 AM
You're having trouble attaching a separate print file sheet because you've laid out your entire page in tables with widths hard-coded into your HTML.

A print-only stylesheet is really only useful if you've used CSS to lay out your page.

fisher999
06-06-2006, 01:05 AM
so what can I do? How to make the print-only stylesheet because I really don't know how to do. Please help! :(

nataliemac
06-06-2006, 01:08 AM
You can't make a useful print-only stylesheet for the page you have. You will need to start over and build your page with a CSS layout without tables.

CSS cannot override width values that are hard-coded into your HTML.

fisher999
06-06-2006, 01:33 AM
You mean hard-code is this statement?
<table width="770" border="0" cellspacing="0" cellpadding="0">

Then i can set the table smaller like 750 , it is ok? If not I need rebuild all webpages again?....

nataliemac
06-06-2006, 01:39 AM
You mean hard-code is this statement?
<table width="770" border="0" cellspacing="0" cellpadding="0">
Yes, that is hard-coding the table width. You have also hard-coded cell widths in your HTML.

Then i can set the table smaller like 750 , it is ok? If not I need rebuild all webpages again?....
Yes, you can adjust your hard-coded HTML values to try and get a page that will print correctly. But exactly how a Web page prints depends on the browser, platform, print driver, etc., so you'll have to test it on a lot of different computers to make sure it prints correctly.

But that makes this an HTML question and has nothing to do with CSS.

Do yourself a favor and learn CSS for your layouts.

fisher999
06-06-2006, 01:41 AM
is it difficult to change all the table to css? how to make? please teach me..

nataliemac
06-06-2006, 01:44 AM
There are a million and one web sites that step through learning CSS layouts. Just Google it.

gYnophObia
06-06-2006, 01:45 AM
is it difficult to change all the table to css? how to make? please teach me..

hey im kinda doing what you are... changing from tables to css... go here ->clicky! (http://www.w3schools.com/css/css_classification.asp) and click on "Creating a homepage without tables" ... i used that as a reference and its helping me a lot ^ ^

fisher999
06-06-2006, 01:49 AM
thanks you kindly help!! hope not so difficult because no expereince at all