Import CSS into your ASP.NET 2.0 Web Form/Master Page

Either ways will do for Web Form and Master Page. Place this in the pages instead of user controls.

The most common way is:

<link href="css/sgdotnet.css" rel="stylesheet" type="text/css" />

You will be suprised that by using the top code is actually compatible with older browsers not really on new browsers like IE 7 or FireFox 2.0.

In order to make sure you can support both old and new browsers, add in a new code just below that <link> tag.

<style type="type/css" media="all">

   @import "css/sgdotnet.css";

</style>

Then you will not face any css problems anymore. Enjoy. 

Published Monday, February 05, 2007 5:32 PM by chuawenching
Filed under: ,