Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 922957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:06:57+00:00 2026-05-15T19:06:57+00:00

I have some very simple HTML: <div id=advisor> <div id=print_this_container> <form> <input type=button value=

  • 0

I have some very simple HTML:

<div id="advisor">
    <div id="print_this_container">
        <form>
            <input type="button" value=" Print this page "
                onclick="window.print();return false;" />
        </form>
    </div>
    <div id="top_section">
        <div class="left_box" style="position: relative;">
            <div id="avatar_container">
                <img class="avatar" src="<%= @advisor.avatar_url %>" />
            </div>
        </div>
        <div class="right_box">
            <h2><strong>Council on Emerging Markets</strong></h2>
        </div>
    </div>

</div>

The associated CSS is:

#advisor{
    width: 800px;
}
#top_section{
    border-bottom: 1px solid #666 !important; 
    height: 200px;
}
.right_box{
    float: left; 
    padding-left: 25px; 
    padding-top: 50px; 
    width: 550px;
}
.left_box{
    background: #ccc; 
    width: 200px; 
    float: left; 
    text-align: center; 
    height: 100%;
}
img.avatar{
    width: 150px;
}

And in my print.css

#advisor{
    width: auto;
    }
#print_this_container{
    display: none;
    }

It looks great in my web page. However, when I print it the following issues occur:

  • The top section border disappears
  • The image shrinks
  • The right box is displayed under the
    left box, it does not float
  • The left box background color
    disappears

Does anyone know how to fix these issues?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T19:06:58+00:00Added an answer on May 15, 2026 at 7:06 pm

    There are a number of problems with printing from within a browser. A lot of the printing-specific stuff doesn’t work on most browsers and even where it’s supported by multiple browsers, it is handled differently

    We’ve jsut spent two weeks trying to print labels using a browser – in the end, we’ve gone for multiple solutions which fail as gracefully as possible…

    Firstly, we detect silverlight and flash – if either is present, we use them to print.

    Next, we have a piece of code which loads a web browser in memory on the server and takes a screenshot of the page at a specific URL – this generates an image which we then return to the client for printing. This is okay for our scenario but you might want to check mem usage/etc. for high volume sites.

    Some things we’ve found: Page margins are a REAL pain (especially for labels!). It seems that only certain versions of Opera will allow you to modify page margins from CSS

    Background images and colors aren’t usually printed by browsers (to save ink) – There’s an option in most browsers to enable printing BG.

    In firefox look in about:config

    print.printer_<PrinterName>.print_bgcolor
    print.printer_<PrinterName>.print_bgimages
    

    In IE I think it’s under File->Page Setup…

    Obviously, neither of these help you much as they can’t be set by the site itself – It depends who the users are going to be whether or not you can ge tthis set intentionally. Failing that, you might try using a normal non-background image placed behind your content?

    In my experience float doesn’t work on printing – However, it’s been a while since I’ve tried and it’s possible this will now work as long as you provide an explicit width for your page (100%?) at present, I think most browsers use shrink-to-fit as default on print media.

    Page width is another interesting one – I’ve only found very limited “width” properties that seem to work – at one point I almost resorted to tables. So far percentages seem to work fine, auto doesn’t.

    Try having a look Here and Here for some solutions and Here for a browser compatability chart

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 499k
  • Answers 500k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This is not pretty but it works: rm -R $(ls… May 16, 2026 at 12:45 pm
  • Editorial Team
    Editorial Team added an answer Yes. Override the base1 and base2 methods in Derived to… May 16, 2026 at 12:45 pm
  • Editorial Team
    Editorial Team added an answer No, you can't. Unfortunately, UIEvent doesn't expose any public way… May 16, 2026 at 12:45 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have some very simple sample code like this: $.ajax({ url: 'demo2.htm', success: function(loadeddata){
I have a very simple HTML. Due to some limitations, I cannot modify the
I have some very simple code below that I can't get to validate on
I have a very simple holding page I built centering a div, anchor and
I have a very simple MVC site that is returning a 404 not found
I have a very simple interface which needs to communicate between processes. It's currently
I have a very simple subclass of UIViewController : @interface RoastChickenViewController : UIViewController {
I have a simple page that contains an iframe. The iframe contains a page
I have following string: <div> text0 </div> prefix <div> text1 <strong>text2</strong> text3 </div> text4
I am trying to create a very simple application (part of my learning program),

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.