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

  • SEARCH
  • Home
  • 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 7877469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:22:48+00:00 2026-06-03T03:22:48+00:00

I have a css stylesheet linked to my webpage. When I view the webpage

  • 0

I have a css stylesheet linked to my webpage. When I view the webpage it look how it is supposed to look, but when I print the document I don’t see the style anymore. I’ve added the css a second time with the attribute: media='print' but it won’t work. Does anybody know how to use the window.print() function and keeping the style to the printing document?

ASPX:

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="cpHead" ClientIDMode="AutoID">
<link rel="stylesheet" type="text/css" media="screen" href="Styles/Site.css" />
<link rel="stylesheet" type="text/css" media="print" href="Styles/Site.css" />
</asp:Content>

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="Main" ClientIDMode="AutoID">
    <asp:Image ID="imgHeader" Width="100%" runat="server" />
    <asp:GridView ID="gvPrintData" Width="100%" runat="server" HeaderStyle-CssClass="printGridHeader" RowStyle-CssClass="printGridRow" AlternatingRowStyle-CssClass="printGridAltRow" />
</asp:Content>

.CS:

Response.Write("<script type='text/javascript'>window.print(); window.onfocus = function() { window.close(); }</script>");

Pageview (how it should look):
Page

Printedview (how it looks on the printed document):
Doc

  • 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-06-03T03:22:49+00:00Added an answer on June 3, 2026 at 3:22 am

    Your stylesheet is actually working – look at the heading font. What I suspect is happening is the browser is not printing background colours.

    Go to the Page Setup / Print setup in your browser and check that background images and colours is turned on.

    Firefox

    Firefox

    IE9

    IE9

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

Sidebar

Related Questions

I have two style sheets for one page. <link rel=stylesheet href=css/lsharecomplete_mob.css media=handheld type=text/css />
i have just deployed my rails application but the css stylesheet wont appear I'm
I have this code in my main CSS file but when I print preview
I have a document with one CSS linked in. How can I replace the
So if there is a css file linked to a webpage like: <link href=style.css
I have a CSS stylesheet defined in the Master Page of my project. On
I have created a CSS stylesheet for my project. Is there any way I
Modifying a SnapPages theme, meaning I only have access to the CSS stylesheet. I
I'm editing a CSS style sheet in Eclipse and I constantly have to copy
I have a CSS file, which contain the style information of my web. Some

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.