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

猜你喜欢

转载自www.cnblogs.com/turnip/p/12131436.html
今日推荐