码迷,mamicode.com
首页 > Web开发 > 详细

css – 当前上下文中不存在“media”的名称

时间:2020-01-02 09:43:18      阅读:103      评论:0      收藏:0      [点我收藏+]

标签:after   void   display   class   font   oct   exist   const   oid   

在ASP.NET MVC 3剃刀视图中,我有代码: 
<!DOCTYPE html>
<html>
<head>
 <style type="text/css">
    @media print
    {
    table { page-break-inside:auto; width: 100%; }
    tr    { page-break-inside:avoid; page-break-after:auto }
    thead { display:table-header-group }
    tfoot { display:table-footer-group }
    }
 </style>
</head>
<body>
<table>

但是我收到错误: 

The name ‘media‘ does not exist in the current context.

谢谢。 

@是Razor中的保留字符。但是你可以使用@@来逃避它: 
@@media print

css – 当前上下文中不存在“media”的名称

标签:after   void   display   class   font   oct   exist   const   oid   

原文地址:https://www.cnblogs.com/turnip/p/12131436.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!