我正在开发 ASP.Net Web 窗体应用程序。特别是一个页面显示了一个 GridView,其中列出了多行数据。 GridView 使用您可以在 Visual Studio 中选择的内置格式设置样式。但是,我需要创建此网页的打印友好版本,但是当我单击打印时,GridView 的样式/CSS 消失了。
有没有办法保留在网页上查看时可见的漂亮样式/CSS?
谢谢你的帮助。
最佳答案
您将使用打印样式表:
@media print
{
/* GridView styling here */
}
或链接到专门用于打印目的的样式表:
<!--These styles styles are only for screens as set by the media value-->
<link rel="stylesheet" href="css/main.css" media="screen">
<!--These styles styles are only for print as set by the media value-->
<link rel="stylesheet" href="css/print.css" media="print">
关于ASP.Net 打印 GridView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19862038/