how to change Background Color (for printing)

Discussion in 'HTML' started by temujin, May 10, 2007.

  1. temujin

    temujin Guest

    Dear Group,

    When I change the background colour in a table like this:

    <TR> <TH COLSPAN=6 BGCOLOR="#99CCFF"><H4>Motherboard</H4></TH> </TR>

    the colour is only visible on the html page. When I print it out (or
    print it to pdf) it´s still in Black&White.

    Can anyone tell me how to change this?

    best regards
    temu
     
    temujin, May 10, 2007
    #1
    1. Advertisements

  2. You should be able to tell the browser at print time that you want to
    print background colors.
     
    Adrienne Boswell, May 10, 2007
    #2
    1. Advertisements

  3. temujin

    Bergamot Guest

    You can only change it for yourself, through your browser settings. You
    cannot "force" other people to print your background colors or graphics.
     
    Bergamot, May 10, 2007
    #3
  4. Sure you can. I can force anyone to do anything I want. If I came to
    your house and held your family/dog/lover/etc hostage and in the
    ransom note I told you I wanted you to print a web page and you had
    better print the background color or image or I would cut off your
    wife's/dog's/kid's/mom's/etc's genitals. I am thinking you would do
    exactly what I told you to do.

    Ok, this is probably not practical, but it would work on any website,
    so, in the pure sense, I CAN force you to do anything I want you to
    do.
     
    Travis Newbury, May 10, 2007
    #4
  5. temujin

    Bergamot Guest

    Probably not. :)
     
    Bergamot, May 10, 2007
    #5
  6. Wow, must be some *JScript* script required to do that!
     
    Jonathan N. Little, May 10, 2007
    #6
  7. temujin

    Neredbojias Guest

    Bah. You underestimate the nature of the human spirit. Besides, what if
    the guy doesn't like his wife and kids?
     
    Neredbojias, May 10, 2007
    #7
  8. temujin

    dorayme Guest

    nah... Travis would send a very graphic flash movie of what would
    happen to his victim's family and believe me, he would get the
    victim to print any background stipulated.
     
    dorayme, May 10, 2007
    #8
  9. temujin

    planb Guest

    You can do it without turning on the option to print background colors
    using CSS. I'm currently trying to figure out the best way of doing
    exactly that....

    Here's a sample that works, doesn't require any images and is only
    slightly ugly....


    <div style= "width:100px; height: 100px;">
    <div style="border-color:E9E9E8 E9E9E8 E9E9E8 E9E9E8;
    margin:10px;float:left;border-width:50px;
    border-style:solid;width:0px;height:0px;
    line-height:0px;">
    </div>
    <span style="position: relative; top: -100px;
    left: .9em;">
    This will have a colored <br />
    background when printing
    </span>
    </div>

    <p />

    <div style="width: 400px; height: 25px; background-color: E9E9E8;">
    No colored background when printing...
    </div>
     
    planb, May 20, 2007
    #9
  10. Note sure what that will accomplish, but one thing I am sure of it is
    not valid CSS.

    HINT borders are added *outside* of a block, what you have here would be
    a 100px square block with a 50px wide border! Also color values in hex
    must be designated with a '#"
     
    Jonathan N. Little, May 20, 2007
    #10
  11. temujin

    J.B. Moreno Guest

    -snip how to print background colors?-
    You say that like it's a problem. It's actually the solution.

    The code that will print a "background" color consists of 3 pieces.
    (1) a 100px square block, (2) a 0px square block with 50px borders that
    are set to a particular color, and finally (3) a span with a relative
    position so that it overlays 2.
    Yes, the result of some cut-n-paste code. If it kept your browser from
    showing what I describe, then my apologies.
     
    J.B. Moreno, May 20, 2007
    #11
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.