HTML : Print tags to get a better print out

Posted on 2005-04-07
Last Modified: 2012-05-05
I have an image with dimensions as 925 X 668 pixels.
This when embedded in a HTML page comes fine on the screen i.e. it fits to the width of the page, but when we take a printout - portrait mode - of the same HTML the image gets cut from right side.

How can I get the full image printed without reducing the image size?
Question by:INDIRA_K
    LVL 5

    Expert Comment


    The HTML is written so the image resizes. The printer sees things differently and prints the entire picture. So just make sure the image can fit in the paper. You can probably change to landscape instead of portrait so it fits.

    Hope this helps.

    LVL 5

    Expert Comment

    That should've been "HTML written in such a way that the image resizes." I was pertaining to how the image would be displayed on the page...sorry for the confusion. :-)

    Author Comment

    I believe that you can specify can "print tags" so that while printing image gets resized appropriately. So I am looking for that "print tag" which can help me achieve it.
    LVL 14

    Accepted Solution

    This is what you need:

    <style media="print" type="text/css">
        width: 462px;
        height: 334px;

    <p>Hello world.</p>
    <img id='myimage' src='925x668.gif' />

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Javascript: Crash Course

    Javascript is not only emerging as the most important language to know, it's flexibility is unique. With Javascript being deployed on the web, mobile and even the desktop this is the one language that all technologists need to know.

    Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
    Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
    The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now