Using a single stylesheet to apply CSS


Today majority of the computer users use various kinds of browser agents to access resources over the Internet and the access to it has become a must with most of the information technology related activities. When it comes to users of accessing the information we can categorize them into various groups, such as desktop users, handheld device users, etc . If we look at the users’ we can see that their preference is mainly towards versions of Internet Explorer, well it could be due to the reason it comes bundled with the operating system itself and we can see that the use of Mozilla Foundation’s Firefox browsers it gaining popularity over the past few years.

Today most of the web developers faces a common problem of applying CSS that supports most of the famous browsers, such as Mozilla Firefox, Internet Explorer, Konqueror, Opera, etc. When it comes to versions of Internet Explorer most of the time we need to use separate hacks and need to get the help of conditional comments in linking specific CSS files to the XHTML/HTML source and CSS descendant selectors methods because currently available versions of IE browsers doesn’t support some of the W3C standards. So web developers mainly use the Firefox browser as the base when applying CSS to web sites and applications.

According to a article on IERoot hack it describes a method of using theStar-HTML hack within the main stylesheet. Just after the body element in the XHTML/HTML source we must include a div element having a unique ID, say for example ‘ie_root_hack’ and rest of the content comes within the div element having the id=’ie_root_hack’ and always remember that it reads by IE browsers only as shown in the following example.

<html>

<head>
<title> Star-HTML hack to answer </title>
</head>

<body>

<!– [ if IE ] –>
<div id=”ie_root_hack”>
<!– [ endif ] –>

<div id=”content”>
<p>Rest of the page related source goes within this block</p>
</div>

<!– [ if IE ] –>
</div> <!– /#ie_root_hack–>
<!– [ endif ] –>

</body>

</html>

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: