SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Incoherent drivel since 1975 Zopester's Avatar
    Join Date
    Feb 2003
    Location
    UK
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS background-image in print stylesheets

    As a little test I decided to recode a page without using a single <img> tag.

    For the interested, here's how:

    HTML:
    Code:
    <h1><span class="hide">Page title</span></h1>
    CSS:
    Code:
    h1 {
    background-image:url(nice_piccie.gif);
    background-repeat:no-repeat;
    width: width of nice_piccie.gif;
    height: height of nice_piccie.gif;
    }
    
    span.hide { display:none; }
    Nice. This way you can have text titles like good accessible web designers, and also have the wonder that is the graphical title. Only downside is certain screenreaders ignore the text because they are able to parse the CSS display:none, and so the meaning of the page is lost. I'm sure there must be a way round this with aural stylesheets, but I dunno.

    However, I'm way off my point here. (Nothing unusual there)

    This technique is great for me. Apart from when I want to print a page. So, (and here's where I'm wondering whether I should have posted this in the browsers section!) can IE be made to display background images when printing? Surprise surprise Mozilla can do it, but I'm left with gaping holes where graphics should be in the print version in IE.

    Long, rambling, off point post. But I hope someone knows the answer.

    Code:
    zopester {
    sleep:none;
    overworked:very;
    }
    Recommended Reading:
    Why we won't help you - An article by Mark Pilgrim.

    http://www.zopester.com - Coming Soon!

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    In IE you have to go to Tools->Internet Options->Advanced and check "Print Background Images" (or some similarly named option).

    If your stylesheet has no "media" attribute defined, or your media is "print" or "all", then Moz/Opera will print the bg images.

  3. #3
    Incoherent drivel since 1975 Zopester's Avatar
    Join Date
    Feb 2003
    Location
    UK
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That sound? That's the sound of me getting my coat.

    Goes to show how often I use IE.

    *suitably humbled*
    Recommended Reading:
    Why we won't help you - An article by Mark Pilgrim.

    http://www.zopester.com - Coming Soon!

  4. #4
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Zopester
    That sound? That's the sound of me getting my coat.

    Goes to show how often I use IE.

    *suitably humbled*
    I've taken to using Mozilla/Opera at work and Phoenix at home . I only use IE to test sites, and for a couple of IE-only sites I visit (my bank ).

  5. #5
    "Of" != "Have" bronze trophy Jeff Lange's Avatar
    Join Date
    Jan 2003
    Location
    Calgary, Canada
    Posts
    2,063
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I HATE IE-ONLY SITES!

    (I still use IE as my primary browser, but that doesn't reduce my rage against IE-only sites)


    And you know what, I also hate sites which say stuff like "Use Mozilla, it's standards compliant" and don't work right in IE just as much as I hate IE-only browsers.
    Who walks the stairs without a care
    It shoots so high in the sky.
    Bounce up and down just like a clown.
    Everyone knows its Slinky.

  6. #6
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by cyborg from dh
    I HATE IE-ONLY SITES!

    (I still use IE as my primary browser, but that doesn't reduce my rage against IE-only sites)


    And you know what, I also hate sites which say stuff like "Use Mozilla, it's standards compliant" and don't work right in IE just as much as I hate IE-only browsers.
    Agreed and agreed. My old college just went IE-only for their registration. Luckly, they only make you aware of the fact that some things may not work right. Washington Mutual bank used to lock you out of your account if you were using anything but IE (or Opera posing as IE ). Also, Intuit's site (TurboTax for the web) gave me errors saying that cookies must be enabled when I used any browser except IE . Phoenix handles cookies just fine!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •