HTML - Is It Possible To Print Content Of A Div?
Hello to all experts in HTML,
I want to know, because when I try to print the contents of a DIV I print all text except the images. I created a DIV centered on my page, and inside there is some text and a background image. I haven't used the <IMG> tag for the background image but the style: background-image:#; <div> <a class="print" href="#" onclick="window.print()"><img src="icon.png" /><br />Print</a> <div id="content"> <p> eccc...... </div> </div> Can you please explain me, why I did not print from what I see from my browser? Thank you! ps. Sorry for my bad English. Similar TutorialsHi Guys. My website contains a lot of text, and its continually printed by clients as it includes pricing etc. At the moment my pricing page is 4 pages of paper, however I wish to be a touch kinder to mother nature and be a bit more eco-friendly so I have created a document with all the pricing on one page which I have saved as a PDF file. I would like to add a link on my website to "Printer Friendly Version" which would link to the PDF and would bring up a print dialog box. What coding would I need to do this? I think it may very well be Java but I'm not the brightest when it comes to this Any help appreciated! I hope this all made sense! Hi, Im trying to make my footer content align correctly to the main content when a window resizes. The apdivs don't seem to want to move at all even with a relative position etc. I have tried everything but just cant get it to work can someone help please? http://pjm.co.uk.uksite4.yourwebserv...splay&PageID=5 Also some one commented before on the amount of css and JS pages. These will al be stripped out as its an Open sources system im using! Thansk alot Joe Hi all I have a print issue in IE v6.x. The website is divided in different frames and I have a menu which contains a print button. This button takes out the content in the main frame and insert it into its own window so it can be printed without the other frames. This works fine in Firefox, if the page is to wide compared to the paper then Firefox automatically resizes the entire page so it fits. This on the other hand does NOT happen in IE, probably because it just does not have than functionality. So the page gets cut and does not look so good when printed. Is there anyway to solve this? This also happens if I have restricted the main div which contains everything to less then a paper size. If the DIV contains other divs besides each other, then the info at the right DIV gets cut when the page is at its end (in width). But like I said this works fine in Firefox since it automatically makes the page smaller. Is there anyway to do something like this in IE as well? Thx in advance for all help! Hi, I can't get the variable E to print at the end by the form answer. It is calculating cubic inches, then the Answer is to gallons. I want to see both answers. Thanks in advance!! Code follows: <HTML> <HEAD> <TITLE>Calculation</TITLE> <SCRIPT LANGUAGE="JavaScript"> function CalculateSum(Atext, Btext, Ctext, Dtext, form) { var A = parseFloat(Atext); var B = parseFloat(Btext); var C = parseFloat(Ctext); var D = parseFloat(Dtext); var E = (A*C*D) + ((A/2) * (B-C)*D); form.Answer.value = E/200 ; } /* ClearForm: this function has 1 argument: form. It clears the input and answer fields on the form. It needs to know the names of the INPUT elements in order to do this. */ function ClearForm(form) { form.input_A.value = ""; form.input_B.value = ""; form.input_C.value = ""; form.input_D.value = ""; form.input_E.value = ""; form.Answer.value = ""; } // end of JavaScript functions --> </SCRIPT> </HEAD> <BODY> <P><FONT SIZE="+2">Calculation</FONT></P> <FORM NAME="Calculator" METHOD="post"> <P>Enter A: <INPUT TYPE=TEXT NAME="input_A" SIZE=10></P> <P>Enter B: <INPUT TYPE=TEXT NAME="input_B" SIZE=10></P> <P>Enter C: <INPUT TYPE=TEXT NAME="input_C" SIZE=10></P> <P>Enter D: <INPUT TYPE=TEXT NAME="input_D" SIZE=10></P> <P><INPUT TYPE="button" VALUE="CALCULATE" name="AddButton" onClick="CalculateSum(this.form.input_A.value, this.form.input_B.value, this.form.input_C.value, this.form.input_D.value, this.form )"></P> <P><INPUT TYPE="button" VALUE="Clear Fields" name="ClearButton" onClick="ClearForm(this.form)"></P> <P>Cubic Inches = <script type="text/javascript"> document.write(E); </script> <br> Gallons =<INPUT TYPE=TEXT NAME="Answer" SIZE=12> </P> </FORM> </BODY> </HTML> In IE6 and FF, my page prints just fine. In IE7, depending on the environment, it either prints next to nothing or a paragraph of text. Either way, it's missing about 2-3 pages of content. I've scoured online and can't find any fixes. Any assistance would be much appreciated. Hi, how can I print the page ? <a>Print the page</a> should I use javascript ? which is the correct command (cross-platform) ? thanks Hey guys, I used to know a lot about html, but then just completely stopped doing anything with websites for too long. I was just wondering how I can replace a word or number with a specified word or number. What I want to achieve: I've got a forum with a couple thousand members and it's picking up in activity and I want to make some names stand out for being helpful. I want to replace their names with an image. But to do so, it'd have to be a code made and added into the footer template. Because obviously I can't edit a username for html image code. So I just need the code to find all instances of a certain username and replace it with what I specified. ------------- Man I really wish I remembered how to do this haha. Thanks guys. I am working on an application within a website. Most of the HTML for the entire site, I did not create myself, just some HTML and CSS for a specific application. Even in that application, I imported some of the text (which contains HTML tags) from a previous application. So, I only did a small portion of the HTML/CSS. My problem is that when users print out this page in IE6, some of the rows of the main table are missing from the printout. For example, this page: http://www.northcarolina.edu/pe_test/sample_pe.php Does any one have any knowledge of a bug that would cause IE6 not to print some rows? Does any one see any reasons why some rows in the tables (the ones with class='workplan') would skip rows when printing? Thank You. If you open an html document in IE8 and go to File/Page Setup, you'll see Margins (Left, Right, Top & Bottom). Anyone know any html code that will change these margins? I created a form with html. At the end of the form there are two buttons, the button "entry", and the button "reset". When clicking on "entry" button i want to print the form's elements. How can i do it? I need a fool-proof method of making a page break for printing purposes. Nice clean break. I tried using the CSS method, but its doenst work in all browswerrs and is very finicky. Any suggestions? Is there any way to avoid to print buttons or images in printer I am setting up a website to print free birthday cards. However I am not at all experienced in html. Basically I want the customers to print the cards without downloading the image. I thought I could do this perhaps by loading what I want printed in an iframe (???) The actual page will have the image with a watermark on it, and a printing link that prints the card without the watermark Hello friends, I work for a company that sends out a monthly newsletter by email. We are trying to motivate people to print out the file to have it instead of just looking at it once in their inbox and forgetting it. So what we were thinking is we could make a file with "Print Newsletter for Pricing" in the price slots, then have another file with all the pricing that when they clicked a (presumably HTML) link like "Print File Here" it would then call up the PDF File with all the prices and print it. Is this possible? Amen, Christapher Hi Guys, I am building a website for a client, and I have included a contact form on the website. It turns out that they would prefer it if the form could be printed out instead of emailed. All I have is 3 fields, and I want them to output to a page where they can print directly. The design of the output page will be minimal as in the end the forms will be faxed to a number. Is there some way I can do this with HTML? Or is advanced language needed? Cheers LTC I have a timesheet template that I have converted from word to html. I'd like to make it so users can type onto the sheet though and print it off showing their name/hours/dates etc. The template is similar looking to this !! Company Logo !! Contact details, fax number, telephone numbers etc Contracted company ------- Contractors Name ------- ================== Day Date Hours Mon --- --- Tue --- --- Wed --- --- Thu --- --- Fri --- --- Sat --- --- Sun --- --- ================== Total hours worked ----- I have a feeling this can be done using javascript but havent a clue how. Or, can I just make text boxes that allow a user to type into but wont be shown on the print out? I'd like it so only the timesheet is printed off with all the entered data rather than any other parts of the website. Hello all, I am looking to see if there is a simple way to provide a print button for static Text and/or images within a simple table. The content will not change, so I want to see if I can provide a programmed print button for the content within each table. The application is a FAQ page of a website. Currently, the page is long and printing a particular FAQ item is not possible. Expecting the viewers to be web-savvy enough to know how to print selected text is out of the question, as well as providing them this tip in writing. There needs to be a print button. I found this: http://download.oracle.com/javase/tu...rinttable.html but since I am not familiar with coding much beyond basic html I am not sure if this applies or how to implement the code examples in a webpage. I use Dreamweaver MX '04 to edit page html. Any help would be greatly appreciated. Thank you in advance. Goodday, I have a verry enoying problem on my company's website: www.tholeholland.nl When you press the print button it takes like 5 min. before it starts printing. Also the file is about 180 mb big.. ?? AND the tekst on the end of the page is left out.. Please help me.. I'have really tryed everything. Thanks! Greetings, Daniel Hi there, I've created a learning tool that outputs a student's results to a flash chart. Thing is they will need a printed copy of this results chart, obviously flash does not print. The only way around this problem I can think to is to take a screenshot of the page, then proceed to print that out. I need some script that will capture the page, then store it in a defined directory with a relevant name for later printing. Yes I know this could be done manually, but the people taking the quiz would more than likely view it as a chance to cheat, plus it looks pretty unprofessional if you have to mess about with paint or a place to paste the file. Does anyone have any ideas for how I'd go about doing this? Hello, Hello, I am using Java servlet to communicate with Sametime chat application. Communication is through HTML (Servlet sends html tags as strings to app). Now, I have photo in servlet which is as byte array. I know how to make image from byte array in Java, but I need to send it, somehow, through these html tags to app and to show it there. Is that possible? thnx in advance, Dragan |