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

在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
posted @ 2020-01-02 08:59  吴土炮Jared  阅读(1309)  评论(0编辑  收藏  举报