Categories

.NET (1) CSS (5) OOP (1) PHP (2) SQL (5) SQL Server (8) TSQL (1)

Wednesday, September 15, 2010

CSS HACKS

Cross browsing is the main issue for the web developer because each browser has its own standards. So sometimes there are some formatting issues in different browsers. There are several techniques to handle these issues. One of them is CSS hacks. You make different CSS files and then check the browser and then load the corresponding CSS.

Here is the syntax of CSS hacks..


<link href="all_browsers.css" rel="stylesheet" type="text/css"> 
<!--[if IE 7]> <link href="IE7.css" rel="stylesheet" type="text/css"> <![endif]-->
<!--[if IE 8]> <link href="IE8.css" rel="stylesheet" type="text/css"> <![endif]-->
<!--[if !IE]>--> <link href="style.css" rel="stylesheet" type="text/css"> <!--<![endif]-->


Now these if statements will check the browser and then load the corresponding CSS file.

No comments:

Post a Comment