CSS STYLE Media types

Posted: Friday, May 18, 2007 in asp.net, Microsoft

Have you ever come across a situation where you need to hide buttons on your page when you want to print that page ?

You can accomplish this buy using media property of the STYLE tag ..

In blow example the style will only apply in the print mode

 

<style type=”text/css” media=”print” >

#btnPrint ,#btnClose

{

visibility:hidden;

}

</style>

 

#btnPrint ,#btnClose are IDs of  the buttons to be hidden

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s