css - trying to use @media to hide print button -


http://www.w3schools.com/css/css_mediatypes.asp 

in .cshtml page using above link use @media.

although when insert code (below) flags @media saying not exist in context. why this?

<html> <head> <style> @media screen   {   p.test {font-family:verdana,sans-serif;font-size:14px;}   } @media print   {   p.test {font-family:times,serif;font-size:10px;}   } @media screen,print   {   p.test {font-weight:bold;}   } </style> </head>  <body> .... </body> </html> 

are using razor syntax? need escape @ symbol

<style> @@media screen   {   p.test {font-family:verdana,sans-serif;font-size:14px;}   } @@media print   {   p.test {font-family:times,serif;font-size:10px;}   } @@media screen,print   {   p.test {font-weight:bold;}   } </style> 

Comments