Browser specific CSS style & Firefox, Safari & IE hacks

As different browsers come into existence, it makes the life of web developers living hell, thankfully Microsoft .net enables ASP.Net server controls to specify browser specific styles

For example:

<asp:Label ID="Label1" runat="server" Text="Browser specific style" ie:Style="color:Red;" mozilla:Style="color:Blue;" style=”color:Yellow;”>asp:Label>

The above label will render in blue color on Firefox and in red color on IE & if the browser is other than IE and FF then the label will be displayed in yellow color.

References:

Programming Microsoft ASP.Net 3.5

http://ryanfarley.com/blog/archive/2008/08/14/more-on-device-filtering-with-asp.net-server-control-properties.aspx

http://weblogs.asp.net/johnkatsiotis/archive/2008/08/12/asp-net-browsers-filter.aspx

Comments

Popular posts from this blog

WPF How to Dispose ViewModel when the associated UserControl (Not Window) closes?

C# How to unit test Dispatcher

WPF: How to Deep Copy WPF object (e.g. UIElement) ?