<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Office-it.orG &#187; CSS</title>
	<atom:link href="http://www.office-it.org/category/web-application/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.office-it.org</link>
	<description>All about Web and Desktop Application</description>
	<lastBuildDate>Tue, 20 Jul 2010 23:38:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Convert PhotoShop Creations into Strict XHTML compliant CSS Web Pages</title>
		<link>http://www.office-it.org/convert-photoshop-creations-into-strict-xhtml-compliant-css-web-pages/</link>
		<comments>http://www.office-it.org/convert-photoshop-creations-into-strict-xhtml-compliant-css-web-pages/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 15:48:02 +0000</pubDate>
		<dc:creator>Hii Hiong Ching</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[photoshop]]></category>
		<category><![CDATA[strict]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://office-it.org/?p=142</guid>
		<description><![CDATA[Upload .psd designs, download .html file and images. It&#8217;s that simple to create CSS compliant webpages. Some web designers may not have fully knowledge to master CSS, and many of us are good enough with little bit of brushing and designing in PhotoShop. Now, I found a great website, PSD to CSS Online, which provide [...]]]></description>
			<content:encoded><![CDATA[<p>Upload .psd designs, download .html file and images. It&#8217;s that simple to create CSS compliant webpages.</p>
<p><a href='http://www.psd2cssonline.com/'><img src="http://office-it.org/wp-content/uploads/2008/04/psd2css_online.jpg" alt="psd2cssonline" title="psd2css_online" width="420" height="316" class="alignnone size-full wp-image-141" /></a></p>
<p>Some web designers may not have fully knowledge to master CSS, and many of us are good enough with little bit of brushing and designing in PhotoShop. Now, I found a great website, <a href="http://www.psd2cssonline.com/">PSD to CSS Online</a>, which provide free service to convert PhotoShop creations into CSS pages online.</p>
<p><span id="more-142"></span>Although this tool may not appeal to big shot designer because they know CSS. It will for sure useful for those who know PhotoShop but do not know CSS. Try it out for your very own unique webpage and even template!</p>
<p><a href="http://www.psd2cssonline.com/">http://www.psd2cssonline.com/</a></p>
<img src="http://www.office-it.org/?ak_action=api_record_view&id=142&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.office-it.org/convert-photoshop-creations-into-strict-xhtml-compliant-css-web-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Combine All CSS Media Styles Into Single File</title>
		<link>http://www.office-it.org/combine-all-css-media-styles-into-single-file/</link>
		<comments>http://www.office-it.org/combine-all-css-media-styles-into-single-file/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 02:37:15 +0000</pubDate>
		<dc:creator>Hii Hiong Ching</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://office-it.org/combine-all-css-media-styles-into-single-file/</guid>
		<description><![CDATA[As a web designer, we know that we can apply different stylesheets for different media. The following is the most common method used. The above code requests two separate stylesheets, one for global media styles (screen, print, handheld, tv&#8230;) and one for print only. There is nothing wrong with the above, but if load time [...]]]></description>
			<content:encoded><![CDATA[<p>As a web designer, we know that we can apply different stylesheets for different media. The following is the most common method used.</p>
<pre lang="css">
<link href="styles/screen.css" rel="stylesheet" type="text/css" media="screen" />
<link href="styles/print.css" rel="stylesheet" type="text/css" media="print" />
</pre>
<p>The above code requests two separate stylesheets, one for global media styles (screen, print, handheld, tv&#8230;) and one for print only. There is nothing wrong with the above, but if load time is an issue you could save yourself a server request by combining your CSS files:</p>
<p><span id="more-100"></span>
<pre lang="css">
/*  all media  */
@media all
{
    body { color:#666; font:13px arial, helvetica, sans-serif; padding:20px 0 30px 0; }
}  

@media print
{
    body { color:#000; font:12px arial, helvetica, sans-serif; padding:0; }
}
</pre>
<p>What you need to do is just address each media by using &#8220;@media [media] { /* css here */ }&#8221;. This method is easier for us to do editing too.</p>
<img src="http://www.office-it.org/?ak_action=api_record_view&id=100&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.office-it.org/combine-all-css-media-styles-into-single-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top 7 CSS Hacks that we often use</title>
		<link>http://www.office-it.org/top-7-css-hacks-that-we-often-use/</link>
		<comments>http://www.office-it.org/top-7-css-hacks-that-we-often-use/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 02:25:15 +0000</pubDate>
		<dc:creator>Hii Hiong Ching</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[hack]]></category>

		<guid isPermaLink="false">http://office-it.org/?p=59</guid>
		<description><![CDATA[If you are trying to do pixel-perfect cross-browser CSS layout, then you have probably ran into problems with IE . I am going to highlight the top 7 CSS hacks that we often use to have pixel perfect design. 1) Box Model Hack The box model hack is used to fix a rendering problem in [...]]]></description>
			<content:encoded><![CDATA[<p>If you are trying to do pixel-perfect cross-browser CSS layout, then you have probably ran into problems with IE . I am going to highlight the top 7 CSS hacks that we often use to have pixel perfect design.</p>
<p><strong>1) Box Model Hack</strong></p>
<p>The box model hack is used to fix a rendering problem in pre-IE 6 browsers, where the border and padding are included in the width of an element, as opposed to added on</p>
<pre lang="css">
padding: 4em;
border: 1em solid red;
width: 30em;
width/**/:/**/ 25em;
</pre>
<p><span id="more-59"></span><strong>2) Conditional Comments</strong></p>
<p>These conditional comments are for IE-only and they’re not supported by any other browser. For other browsers they are just an ordinary comments and therefor, they are safe to use.</p>
<p>The typical usage is as follows:</p>
<pre lang="css">
<!--[if IE]>Some CSS Code Here<![endif]-->
</pre>
<p>The above code applies to all versions of Internet Explorer, i.e. 5.01, 5.5 and 6.0, but now we want to apply it to versions of Internet Explorer, i.e. 5.01, 5.5 and 6.0, so we will apply the following condition:</p>
<pre lang="css">
<!--[if lte IE 6]>Some CSS Code Here<![endif]-->
</pre>
<p>After we finish testing, we remove all hacks to separate file(s), so the main CSS is clean and tidy. This separate file is then called in the header section of a file within conditional comments.</p>
<pre lang="css">
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="ie_hacks.css" /><![endif]-->
</pre>
<p>Condition is one of the following:</p>
<p>* IE (Any version of IE)<br />
* lt IE version (Versions less than version)<br />
* lte IE version(Versions less than or equal to version)<br />
* IE version (Only version)<br />
* gte IE version (Versions greater than or equal to version)<br />
* gt IE version (Versions greater than version)</p>
<p>Version is the version of Internet Explorer, typically 5, 5.5, 6, or 7, you can read more info about this at <a href="http://www.quirksmode.org/css/condcom.html">Quirksmode</a>.</p>
<p><strong>3) Min-width and Max-width of an element</strong></p>
<p>IE doesn’t understand this command, so we’ll need a new way of making this work in this browser. Let’s take a quick example, we need to apply this to a div with id=&#8221;wrapper&#8221;:</p>
<pre lang="php">
<wrapper>
<div id="nav">
</pre>
<p>Next we create our CSS commands, so as to create a minimum width of 750px:</p>
<pre lang="css">
#wrapper{
    min-width: 750px;
    width:expression(document.body.clientWidth < 750? "750px": "auto" );
}
</pre>
<p>You might also want to combine this minimum width of 750px with a maximum width 1220px:</p>
<pre lang="css">
#wrapper{
    min-width: 750px;
    max-width: 1220px;
    width:expression(document.body.clientWidth < 750? "750px" : document.body.clientWidth > 1220? "1220px" : "auto");
}
</pre>
<p>Another Alternative for for min-height without javascript is to use <a href="http://www.dustindiaz.com/min-height-fast-hack/Min-Height">Dustin Diaz</a>’ nice hack: :</p>
<pre lang="css">
#id{
    min-height: 100px;
    height:auto !important;
    height:100px;
}
</pre>
<p><strong>4) Easy Selectors</strong></p>
<p>Most in-CSS hacks deal with selector bugs. Below is a list of different IE versions and the beginnings of selectors that are known to select elements in them. All of these selectors use valid CSS.</p>
<p>* IE 6 and below</p>
<pre lang="css">* html {}</pre>
<p>* IE 7 and below</p>
<pre lang="css">*:first-child+html {} * html {}</pre>
<p>* IE 7 only</p>
<pre lang="css">*:first-child+html {}</pre>
<p>* IE 7 and modern browsers only</p>
<pre lang="css">html>body {}</pre>
<p>* Modern browsers only (not IE 7)</p>
<pre lang="css">html>/**/body {}</pre>
<p>* Recent Opera versions 9 and below</p>
<pre lang="css">html:first-child {}</pre>
<p><strong>5)Whatever: hover</strong></p>
<p>The :hover selector enables you to have cool effect for html elements like and in tables.Most browsers have no problem with this, except IE which look at the stylesheets and each individual rule with javascript.<br />
If :hover rules can be tracked, and .htc can be used to change an elements behavior, then it should be possible to create a behavior that enables :hover for any element.</p>
<p>You can read more about this <a href="http://www.xs4all.nl/~peterned/csshover.html">here</a></p>
<p><strong>6)Transparent PNGs</strong></p>
<p>IE dosn’t handle transparent PNG too well. You’ll get an ugly grayish type background wherever it’s supposed to be transparent. And we cann’t just use GIFs because aren’t good for higher resolution images. So we need a CSS hack to fix this. Follow the following steps and you will be set:</p>
<p>* A HTC script and a transparent GIF will be used to solve this issue. You can download both files <a href='http://office-it.org/wp-content/uploads/2008/03/transparentpngs.zip' title='Transparent pngs'>transparentpngs.zip</a><br />
* Now just upload these 2 files to wherever you store your IE.css file.<br />
* Add one simple line of CSS code to your ie.css file:</p>
<pre lang="css">img.pngfix { behavior: url(pngHack.htc); }</pre>
<p>Another solution can be found at <a href="http://komodomedia.com/blog/index.php/2007/11/05/css-png-image-fix-for-ie/">Komodomedia</a></p>
<p><strong>7) Stylegala- No More CSS Hacks</strong></p>
<p>Stylegala’s method is to detect browser version and serve different CSS rules to different user agents, without using hacks or conditional comments. At the same time the end user or validator will never see the CSS rules specified for other browsers than the one they are using. He used some simple PHP code to detect browser type exactly as any CSS hack.</p>
<img src="http://www.office-it.org/?ak_action=api_record_view&id=59&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.office-it.org/top-7-css-hacks-that-we-often-use/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Rounded Corners Without Images</title>
		<link>http://www.office-it.org/create-rounded-corners-without-images/</link>
		<comments>http://www.office-it.org/create-rounded-corners-without-images/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 18:50:45 +0000</pubDate>
		<dc:creator>Hii Hiong Ching</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[corner]]></category>
		<category><![CDATA[table]]></category>

		<guid isPermaLink="false">http://office-it.org/?p=54</guid>
		<description><![CDATA[Here is a simple way to create rounded corners without images needed. It is supported by IE, Firefox, Opera and etc. This idea is to draw lines of certain length in rblocktop and rblockbottom divs. Margin&#8217;s value controls line length (width). Just copy the following code and save as html file. body { font: 14px [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple way to create rounded corners without images needed. It is supported by IE, Firefox, Opera and etc. This idea is to draw lines of certain length in rblocktop and rblockbottom divs. Margin&#8217;s value controls line length (width).</p>
<p><img src='http://office-it.org/wp-content/uploads/2008/02/rounded-corner.png' alt='Rounded Corner' /></p>
<p><span id="more-54"></span>Just copy the following code and save as html file.</p>
<pre lang="php">
<html>
<head>
<style type="text/css">
body {  font: 14px Arial, Helvetica, sans-serif;
        background-color: #fff;
        color: #fc0;
}
.rblock {
        background-color: #900;
}
.rblock *.m5 {
        margin: 0 5px;
}
.rblock *.m3 {
        margin: 0 3px;
}
.rblock *.m2 { 
        margin: 0 2px;
}
.rblock *.m1 {
        margin: 0 1px;
}
.rblock p.content {
        padding: 0 20px;
}
.rblocktop, .rblockbottom {
        background-color: #fff; /* must be of the same as body bg-color */
        display: block;
        width: 100%;
}
.rblocktop *, .rblockbottom * {
        background-color: #900; /* must be of the same as .rblock bg-color */
        display: block;
        height: 1px;
        overflow: hidden;
}
</style>

</head>

<body>
<center>
<div class="rblock" style="width: 300px;">
<div class="rblocktop">
        <span class="m5"></span>
        <span class="m3"></span>
        <span class="m2"></span>
        <span class="m1"></span>
        <span class="m1"></span>
    </div>
<p class="content" style="text-align: left; /* change this style to whatever you want or remove it */">
This is a simple way to create rounded corner without images. It is supported by IE, Firefox, Opera and etc.
This idea is to draw lines of certain length in rblocktop and rblockbottom divs.
Value of margin controls line length (width). - Office-it.orG
<div class="rblockbottom">
        <span class="m1"></span>
        <span class="m1"></span>
        <span class="m2"></span>
        <span class="m3"></span>
        <span class="m5"></span>
    </div>
</div>

</center>
</body>
</html>
</pre>
<img src="http://www.office-it.org/?ak_action=api_record_view&id=54&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.office-it.org/create-rounded-corners-without-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP CSS Stylesheet Switcher</title>
		<link>http://www.office-it.org/php-css-stylesheet-switcher/</link>
		<comments>http://www.office-it.org/php-css-stylesheet-switcher/#comments</comments>
		<pubDate>Wed, 27 Feb 2008 06:03:45 +0000</pubDate>
		<dc:creator>Hii Hiong Ching</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[style]]></category>

		<guid isPermaLink="false">http://office-it.org/?p=48</guid>
		<description><![CDATA[Hands up all those who have ever needed to have some kind of style sheet switcher on their site. Yep, that&#8217;s what I thought, at least a couple of you! Seriously though, with the current move toward more fully accessible websites, the need for various stylesheets to be attached to your pages has become more [...]]]></description>
			<content:encoded><![CDATA[<p>Hands up all those who have ever needed to have some kind of style sheet switcher on their site. Yep, that&#8217;s what I thought, at least a couple of you! Seriously though, with the current move toward more fully accessible websites, the need for various stylesheets to be attached to your pages has become more of a neccessity than ever before. Indeed we use the following solution ourselves and you can see it in action by clicking on the &#8216;Zoom&#8217; (then &#8216;Zoom Out&#8217;) button at the top of the page.</p>
<p><strong>What is this?</strong></p>
<p>Essentially what you have is an array of predefined stylesheets that are called and set to and from a cookie (this cookie stores a numerical value representing the stylesheet number that is selected). Make sure you advise visitors you use cookies in your terms and conditions. If the visitor has chosen to view the site in a style other than the one defined as default, then when they return to the site at a later date, it should be presented to them in the style that they were previously viewing in. Of course this is fine as long as your visitor has Javascript enabled in their browser so that the cookie can be set and retrieved, but what if they don&#8217;t? Well the script will still work by making use of PHP SESSION variables to store the same data. This does mean that the style sheet selected will not be stored on the clients machine for future use, but hey, we can&#8217;t have it all right?</p>
<p><span id="more-48"></span>The script has 3 distinct parts:</p>
<p>   1. Stylesheet Array and Default Selection<br />
   2. Stylesheet Links<br />
   3. Style Switcher</p>
<p>that are described below, along with installation tips for each section. </p>
<p><strong>1. Stylesheet Array and Default Selection</strong></p>
<pre lang="php">
<link href="style1.css" rel="stylesheet" type="text/css" /></pre>
<p>The above code can be broken down into parts as follows:</p>
<p><strong>DEFINE STYLESHEETS</strong></p>
<p>Here you have a two dimensional array named `styleSheets` that holds the references to the text you wish to appear in the anchor tag for the sheet , the text for the title of the anchor tag, and the code for the actual link to the sheet as it will appear on the page (these will be explained further on in this article). These are stored in &#8216;text&#8217;, &#8216;title&#8217;, and &#8216;sheet&#8217; respectively. Obviously the array can be extended to account for as many stylesheets as you could wish to have by simply adding another &#8216;set&#8217; and incrementing the numeric index accordingly.</p>
<p><strong>DEFAULT STYLESHEET</strong></p>
<p>This is just a variable to allow you to define a default style sheet for when there is no cookie to read. Set this to any numeric index from the style array.</p>
<p><strong>SET STYLESHEET</strong></p>
<p>This little code snippet looks to see if the visitor has chosen a different stylesheet than the default one by looking to see if a cookie (called STYLE) has been set (or by using PHP SESSION variables if Javascript is disabled). If the cookie is present then it sets the stylesheet accordingly by echoing out the value of &#8216;sheet&#8217; (the actual link to the stylesheet) from the styleArray against the numeric value stored in the cookie to the page. If there is no cookie, then it uses the value assigned to defaultStyleSheet. </p>
<p><strong>Installation</strong></p>
<p>This piece of code really should be placed in an include file and named appropriately (e.g. stylearray.php) so that it can be called into any page of your site. To include this php file in any other php page use:</p>
<pre lang="php">

<b>Warning</b>:  include(path/to/file/stylearray.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in <b>/home/icreativem/domains/office-it.org/public_html/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()'d code</b> on line <b>66</b>

<b>Warning</b>:  include() [<a href='function.include'>function.include</a>]: Failed opening 'path/to/file/stylearray.php' for inclusion (include_path='.:/usr/local/lib/php') in <b>/home/icreativem/domains/office-it.org/public_html/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()'d code</b> on line <b>66</b>
</pre>
<p>It is worth noting that the best place to include this file would be in the head of the calling php document.</p>
<p><strong>2. Stylesheet Links</strong></p>
<pre lang="php">
<a href='styleswitcher.php?SETSTYLE=0' title='Click here to set Style 1'>Style 1 Version</a><a href='styleswitcher.php?SETSTYLE=1' title='Click here to set Style 2'>Style 2 Version</a></pre>
<p>The above piece of code can be placed anywhere on your page where you wish to display the links for the different stylesheets. Quite simply, the code is a loop that runs through the `styleSheets` array and echo&#8217;s out an anchor tag with the values set in that array. The links will call a page called styleswitcher.php and will pass a numeric value through to it (via SETSTYLE) that will be used to set the cookie for the selected stylesheet. Of course these don&#8217;t have to be links, you could use a form element to achive the same thing.</p>
<p><strong>Installation</strong></p>
<p>This piece of code can either be written directly on any page that the style links are to appear on in the position in which the are to appear, or it can be be placed in an include file and called into a page in the same manor as described above.</p>
<p><strong>3. Style Switcher</strong></p>
<pre lang="php">

<b>Warning</b>:  Cannot modify header information - headers already sent by (output started at /home/icreativem/domains/office-it.org/public_html/wp-includes/feed-rss2.php:11) in <b>/home/icreativem/domains/office-it.org/public_html/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()'d code</b> on line <b>102</b>
</pre>
<p>The above code MUST be placed, on it&#8217;s own, in a seperate file called &#8216;styleswitcher.php&#8217;. This file can sit in the same directory/folder as the page calling for it.</p>
<p>Note: You may need to add a forward slash &#8220;/&#8221; before the closing bracket thus:</p>
<pre lang="php">
setcookie("STYLE",$_REQUEST["SETSTYLE"],time()+31622400,"/");
</pre>
<p>in order make the cookie available across the whole of the domain.</p>
<p>This code can be broken down again as follows: </p>
<p><strong>SET COOKIE FOR 1 YEAR</strong></p>
<p>Does exactly what it says on the tin! Checks to see if a value called &#8216;SETSTYLE&#8217; has been passed to it from the caller link. If &#8216;SETSTYLE&#8217; is there, the script will then test to see if a cookie can be set on the clients machine, if it can then a cookie is set, if not then the script will make use of a session variable. Both the cookie and the session are called &#8216;STYLE&#8217; is are to the value of &#8216;SETSTYLE&#8217;.</p>
<p><strong>RETURN TO CALLER PAGE</strong></p>
<p>Quite simply this just redirects the user back to the page that they came from, which should now be displayed in the newly shosen style sheet.</p>
<p><strong>Installation</strong></p>
<p>This is a separate stand alone php file that has only the code listed and nothing else, and should sit in the same directory/folder as the page calling for it.</p>
<p><strong>Final Thoughts</strong></p>
<p>Phew! seems like quite a bit of work for something so small, but it is actualy very simple once you have used it. Obviously the script can be changed to fit your specific needs as with any script, but as a basic it should work fine, and indeed has proven to do so. Try it out yourself and please let us know how you get on. </p>
<img src="http://www.office-it.org/?ak_action=api_record_view&id=48&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.office-it.org/php-css-stylesheet-switcher/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS image replacement</title>
		<link>http://www.office-it.org/css-image-replacement/</link>
		<comments>http://www.office-it.org/css-image-replacement/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 03:19:39 +0000</pubDate>
		<dc:creator>Hii Hiong Ching</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[image]]></category>

		<guid isPermaLink="false">http://office-it.org/?p=43</guid>
		<description><![CDATA[Plenty of new and interesting revisions to the original Fahrner Image Replacement technique sprouted up in late 2003. This was an attempt to consolidate them. Please note that this page is no longer being maintained. Requirements: the replacement must solve the screen reader problem, and it must address the &#8220;images off, css on&#8221; problem. It [...]]]></description>
			<content:encoded><![CDATA[<p>Plenty of new and interesting revisions to the original Fahrner Image Replacement technique sprouted up in late 2003. This was an attempt to consolidate them. Please note that this page is no longer being maintained.</p>
<p>Requirements: the replacement must solve the screen reader problem, and it must address the &#8220;images off, css on&#8221; problem. It is also hoped that a solution will be found that reduces the need for empty &lt;span&gt; elements. The successful technique must work in browsers back to 5.x, but as of the time of writing none of these appear to fail so browser support matrices will be spared.</p>
<p>The two most promising techniques, Phark and Gilder/Levin are available on a <a href="http://www.mezzoblue.com/tests/revised-image-replacement/testsuite.html">reduced page</a> for screenreader testing.<br />
<span id="more-43"></span></p>
<h3>Classic FIR</h3>
<p>Using Doug Bowman&#8217;s <a href="http://www.stopdesign.com/also/articles/replace_text/">original tutorial</a>, we surround the text with empty <code>span</code>s to hide it with <code>display: none;</code><br />
<strong>Issues:</strong> most screen readers will not pick up the text when it is not rendered on-screen, nothing shows up under &#8220;images off, css on&#8221; scenarios, semantically meaningless &lt;span&gt;s necessary.</p>
<p>HTML code:</p>
<pre lang="html">
<h3 id="header">
    <span>Revised Image Replacement</span>
</h3>
</pre>
<p>CSS code:</p>
<pre lang="css">
/* css */
#header {
	width: 329px;
	height: 25px;
	background-image: url(sample-opaque.gif);
	}
#header span {
	display: none;
	}
</pre>
<h3>Single-pixel &lt;img&gt; Replacement</h3>
<p>Radu Darvas <a href="http://www.homelesspixel.de/rt/textimage.html">proposed</a> adding a one-pixel, transparent GIF image to the header to restore <code>alt</code> text.<br />
<strong>Issues:</strong> an extra meaningless element is added to the page.</p>
<p>HTML code:</p>
<pre lang="html">
<h3 id="header">
 <img src="shim.gif" alt="Revised Image Replacement" /> <span>Revised Image Replacement</span>
</h3>
</pre>
<p>CSS code:</p>
<pre lang="css">
/* css */
#header {
	width: 329px;
	height: 25px;
	background-image: url(sample-opaque.gif);
	}
#header span {
	display: none;
	}
</pre>
<h3>Radu Method</h3>
<p>Radu has also conceived a method involving margin positioning to hide the text. Similar in theory to the Phark Method below, Radu&#8217;s method works in IE5.<br />
<strong>Issues:</strong> doesn&#8217;t solve css on/images off problem.</p>
<p>HTML code:</p>
<pre lang="html">
<h3 id="header">
 Revised Image Replacement
</h3>
</pre>
<p>CSS code:</p>
<pre lang="css">
/* css */
#header {
	background: url(sample-opaque.gif) no-repeat top right;
	width: 2329px;
	height: 25px;
	margin: 0 0 0 -2000px;
	}
</pre>
<h3>Leahy/Langridge Method</h3>
<p><a href="http://www.moronicbajebus.com/playground/cssplay/image-replacement/">Seamus Leahy</a> and <a href="http://www.kryogenix.org/code/browser/lir/">Stuart Langridge</a> independently discovered a method which allows dropping of the <code>span</code> and, theoretically (although this isn&#8217;t confirmed) restores accessibility thanks to <code>overflow: hidden;</code><br />
<strong>Issues:</strong> nothing shows up under &#8220;images off, css on&#8221; scenarios, box model hack required to work in IE5.</p>
<p>HTML code:</p>
<pre lang="html">
<h3 id="header">
 Revised Image Replacement
</h3>
</pre>
<p>CSS code:</p>
<pre lang="css">
/* css */
#header {
	padding: 25px 0 0 0;
	overflow: hidden;
	background-image: url(sample-opaque.gif);
	background-repeat: no-repeat;
	height: 0px !important;
	height /**/:25px;
	}
</pre>
<h3>Phark Method</h3>
<p>Greatly simplifying Leahy/Langridge, Mike Rundle of Phark offered a solution that uses text-indent to hide the text. This is confirmed to work in JAWS, solving the accessibility problem.<br />
<strong>Issues:</strong> nothing shows up under &#8220;images off, css on&#8221; scenarios, doesn&#8217;t work in IE5.<br />
HTML code:</p>
<pre lang="html">
<h3 id="header">
	Revised Image Replacement
</h3>
</pre>
<p>CSS code:</p>
<pre lang="css">
/* css */
#header {
	text-indent: -100em;
	overflow: hidden;
	background: url(sample-opaque.gif);
	height: 25px;
	}
</pre>
<h3>Phark Revisited</h3>
<p>Further probing has revealed weaknesses with the previous one, revolving around scrollbars in Safari, and breakage in IE5.<br />
<strong>Issues:</strong> doesn&#8217;t solve images off/css on.</p>
<p>HTML code:</p>
<pre lang="html">
<h3 id="header">
	Revised Image Replacement
</h3>
</pre>
<p>CSS code:</p>
<pre lang="css">
/* css */
#header {
	text-indent: -5000px;
	background: url(sample-opaque.gif);
	height: 25px;
	}</pre>
<h3>Dwyer Method</h3>
<p>From Leon Dwyer comes a twist on Classic FIR. Works in seemingly everything known at the present time, including screenreaders.<br />
<strong>Issues:</strong> doesn&#8217;t solve images off/css on, still requires extra span.</p>
<p>HTML code:</p>
<pre lang="html">
<h3 id="header">
	<span>Revised Image Replacement</span>
</h3>
</pre>
<p>CSS code:</p>
<pre lang="css">
/* css */
#header {
	width: 329px;
	height: 25px;
	background-image: url(sample-opaque.gif);
	}
#header span {
	display: block;
	width: 0;
	height: 0;
	overflow: hidden;
	}</pre>
<h3>Gilder/Levin Method</h3>
<p><a href="http://blog.tom.me.uk/2003/08/07/">Tom Gilder</a> and <a href="http://levin.grundeis.net/files/20030809/alternatefir.html">Levin Alexander</a> proposed a further variation that theoretically fixes the accessibility problems (verification needed, but it&#8217;s almost assured this works in JAWS et. al), and allows the text to show up even if images are turned off.<br />
<strong>Issues:</strong> extra empty span, transparent images don&#8217;t hide text.</p>
<p>(note: header duplicated to illustrate transparency problem)</p>
<p>HTML code:</p>
<pre lang="html">
<h3 id="header">
	<span></span>Revised Image Replacement
</h3>
</pre>
<p>CSS code:</p>
<pre lang="css">
/* css */
#header {
	width: 329px;
	height: 25px;
	position: relative;
	}
#header span {
	background: url(sample-opaque.gif) no-repeat;
	position: absolute;
	width: 100%;
	height: 100%;
	}</pre>
<h3>Lindsay Method</h3>
<p><a href="http://www.maxdesign.com.au/presentation/headings-as-images/index.cfm#option4">Russ Weakley</a> writes that by setting your fonts to a tiny, 1px size and matching fore- and background-colours, you don&#8217;t even need to hide the text.<br />
<strong>Issues: </strong>doesn&#8217;t solve images off/CSS on, doesn&#8217;t work on anything but flat-colour backgrounds.</p>
<p>HTML code:</p>
<pre lang="html">
<h3 id="header">
	Revised Image Replacement
</h3>
</pre>
<p>CSS code:</p>
<pre lang="css">
/* css */
#header {
	background: url(sample-opaque.gif) no-repeat;
	width: 329px;
	height: 25px;
	font-size: 1px;
	color: #xxxxxx;
	}</pre>
<h3>Shea Enhancement</h3>
<p>And finally, no matter which method you use, you end up losing alt text tooltips on hover that you and your users might be used to seeing on images. Technically, you shouldn&#8217;t rely on this anyway, since title is far more appropriate for tool-tips. So by adding a title back to your header, you can restore these little hover effects to your site.</p>
<p>HTML code:</p>
<pre lang="html">
<h3 id="header" title="Revised Image Replacement">
	<span></span>Revised Image Replacement
</h3>
</pre>
<p>CSS code:</p>
<pre lang="css">
/* css */
#header {
	width: 329px;
	height: 25px;
	position: relative;
	}
#header span {
	background: url(sample-opaque.gif) no-repeat;
	position: absolute;
	width: 100%;
	height: 100%;
	}</pre>
<p>Source: http://www.mezzoblue.com/tests/revised-image-replacement/</p>
<img src="http://www.office-it.org/?ak_action=api_record_view&id=43&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.office-it.org/css-image-replacement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compress CSS code</title>
		<link>http://www.office-it.org/compress-css-code/</link>
		<comments>http://www.office-it.org/compress-css-code/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 06:13:26 +0000</pubDate>
		<dc:creator>Hii Hiong Ching</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[compress]]></category>

		<guid isPermaLink="false">http://office-it.org/?p=20</guid>
		<description><![CDATA[When you develop a website you know that you will always have to keep a balance between design and productivity. You need good working pages, easy layout, easy navigation, impressive design etc. I&#8217;m not going to talk about every aspect today but I will share with you some of the tools I like to use [...]]]></description>
			<content:encoded><![CDATA[<p>When you develop a website you know that you will always have to keep a balance between design and productivity. You need good working pages, easy layout, easy navigation, impressive design etc.</p>
<p>I&#8217;m not going to talk about every aspect today but I will share with you some of the tools I like to use when it comes to CSS, bandwith and a faster loading. More exactly, how to compress a CSS code without making the code to look so ugly and unreadable. If your design is based on a lightweight css code than I guess you shouldn&#8217;t worry about this but if you like to impress your visitors with visual elements, you can&#8217;t get it done without a big css file.</p>
<p>There are many CSS compression tools to find on the Internet at this moment like <a href="http://csstidy.sourceforge.net/" target="_blank">CSSTidy</a> which takes your input (it must be a valid CSS code otherwise the result might fail to impress) and removes blank lines, comments etc. It has many options to work with.</p>
<p>Ok &#8230; so what is the point. The point is one that I&#8217;ve experienced a lot lately. I often decided to &#8220;parse and optimize&#8221; my CSS code using this tools but I changed my mind short after. Why? Because I do like to update my CSS&#8217;s, to add things, delete things and so on and, after using a tool like CSSTidy, my code was so hard to follow. I had only 1 line and I couldn&#8217;t find anything without using the CTRL + F magic trick. You lose time, development time.</p>
<p><span id="more-20"></span>I&#8217;m going to share with you something else. Found <a href="http://www.ibloomstudios.com/articles/php_css_compressor/" target="_blank">here</a>. This is a small trick to keep our code intact but to compress it the same time. You need to add some PHP lines right at the very top of your css file and another line at the bottom of it. The user&#8217;s browser will request the stylesheet like usual but the server will first read the lines that are at the top and compress it following our PHP code. The stylesheet will be compressed and outputted to the user&#8217;s browser.</p>
<p>This is an awesome tool if you ask me. I&#8217;m sure it will be a dream come true to many designers and web developers.</p>
<p><img src="http://www.ibloomstudios.com/images/phpCssCompress.gif" alt="CSS PHP Compress" /></p>
<p>Here&#8217;s the code to put at the very start of your css file:</p>
<pre lang="php">
< ?php
  header('Content-type: text/css');
  ob_start("compress");
  function compress($buffer) {
    // remove comments
    $buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer);
    // remove tabs, spaces, newlines, etc.
    $buffer = str_replace(array("\r\n", "\r", "\n", "\t", '  ', '    ', '    '), '', $buffer);
    return $buffer;
  }
?>
</pre>
<p>Next, add this code to the very bottom of your CSS stylesheet:</p>
<pre lang="php">
< ?php ob_end_flush();?>
</pre>
<p>From the author&#8217;s website:</p>
<p>&#8220;The first line let&#8217;s the browser know that this is a CSS stylesheet. Next, it starts the overflow buffer collection for later processing with the &#8220;compress&#8221; function. The compress function is used to remove all comments and spacing. Finally, the compressed CSS is sent to the browser.&#8221;</p>
<p>&#8220;Basically, this tells PHP to stop collecting output, and to run the previously specified &#8220;compress&#8221; function. After that, the compressed CSS stylesheet is sent to the browser. You can <a href="http://www.ibloomstudios.com/css-compress.css">download the PHP CSS Compressor Template file</a> with the required PHP code included to get started quick.&#8221;</p>
<p>&#8220;If you want to reference the file using a file name such as &#8220;screen.css&#8221; and have the PHP code parsed, you could use SetHandler in your .htaccess file like this:&#8221;</p>
<pre lang="text">
<files>
  SetHandler  application/x-httpd-php
</files></pre>
<img src="http://www.office-it.org/?ak_action=api_record_view&id=20&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.office-it.org/compress-css-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build in Font Flexibility to Pages using the ems Unit</title>
		<link>http://www.office-it.org/build-in-font-flexibility-to-pages-using-the-ems-unit/</link>
		<comments>http://www.office-it.org/build-in-font-flexibility-to-pages-using-the-ems-unit/#comments</comments>
		<pubDate>Fri, 04 Jan 2008 08:14:16 +0000</pubDate>
		<dc:creator>Hii Hiong Ching</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[ems]]></category>
		<category><![CDATA[font]]></category>

		<guid isPermaLink="false">http://office-it.org/?p=10</guid>
		<description><![CDATA[Fonts are an integral and essential part of the web page experience for your users. Commonly, designers use pixels as the measurement for determining the size of a font on-screen. Dreamweaver provides a selection of measurement options, but it is ems that is a popular choice due to its flexibility. The ems unit is essentially [...]]]></description>
			<content:encoded><![CDATA[<p>Fonts are an integral and essential part of the web page experience for your users. Commonly, designers use pixels as the measurement for determining the size of a font on-screen. Dreamweaver provides a selection of measurement options, but it is ems that is a popular choice due to its flexibility. The ems unit is essentially resizable, for browsers that support this, and their size is relative to a user&#8217;s font size preference. For example, if the size of font in the body tag is determined as 100%, all further text is relative to this point. This can be reduced or increased, i.e. 90%, to suit a page design as required. Styling text so that is 0.5ems means that it will always be half the size of the base text. On the opposite scale, 2.0 ems text will always be twice the size of the base text.</p>
<img src="http://www.office-it.org/?ak_action=api_record_view&id=10&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.office-it.org/build-in-font-flexibility-to-pages-using-the-ems-unit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Pseudo-classes</title>
		<link>http://www.office-it.org/css-pseudo-classes/</link>
		<comments>http://www.office-it.org/css-pseudo-classes/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 09:26:30 +0000</pubDate>
		<dc:creator>Hii Hiong Ching</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Pseudo-classes]]></category>

		<guid isPermaLink="false">http://office-it.org/?p=9</guid>
		<description><![CDATA[Pseudo-class are an interesting group of selectors in CSS that apply to elements when they&#8217;re in a certain state or condition, such as with a link, when the mouse is over it. This makes for some interesting and lightweight visual effects. Pseudo-class (CSS2.1) Description Applies to :link Applies to links that have not been visited. [...]]]></description>
			<content:encoded><![CDATA[<p>Pseudo-class are an interesting group of selectors in CSS that apply to  elements when they&#8217;re in a certain state or condition, such as with  a link, when the mouse is over it. This makes for some interesting and  lightweight visual effects.</p>
<table border="1" cellpadding="1" cellspacing="0" width="100%">
<tr>
<th style="background-color: #333333; color: #ffffff" width="20%">Pseudo-class (CSS2.1)</th>
<th style="background-color: #333333; color: #ffffff" width="60%">Description</th>
<th style="background-color: #333333; color: #ffffff">Applies to</th>
</tr>
<tr>
<td bgcolor="#ffffea" width="20%">:link</td>
<td bgcolor="#ffffea" width="60%">Applies to links that have not been visited.</td>
<td bgcolor="#ffffea" width="20%">links</td>
</tr>
<tr>
<td bgcolor="#ffffea" width="20%">:visited</td>
<td bgcolor="#ffffea" width="60%">Applies to links that have been visited.</td>
<td bgcolor="#ffffea" width="20%">links</td>
</tr>
<tr>
<td bgcolor="#ffffea" width="20%">:hover</td>
<td bgcolor="#ffffea" width="60%">Applies to an element which the mouse is currently over.</td>
<td bgcolor="#ffffea" width="20%">all</td>
</tr>
<tr>
<td bgcolor="#ffffea" width="20%">:active</td>
<td bgcolor="#ffffea" width="60%">Applies to an element currently being activated by the user (ie: the mouse is held down over).</td>
<td bgcolor="#ffffea" width="20%">all</td>
</tr>
<tr>
<td width="20%">:focus</td>
<td width="60%">Applies to an element while it has the user focus.</td>
<td width="20%">all</td>
</tr>
<tr>
<td width="20%">:first-child</td>
<td width="60%">Matches an element that is the first child of some other element.</td>
<td width="20%">all</td>
</tr>
<tr>
<td width="20%">:first-letter</td>
<td width="60%">Applies to the first letter of a paragraph.</td>
<td width="20%">block level elements</td>
</tr>
<tr>
<td width="20%">:first-line</td>
<td width="60%">Applies to the first formatted line of a paragraph.</td>
<td width="20%">block level elements</td>
</tr>
<tr>
<td width="20%">:lang</td>
<td width="60%">Applies to an element when it&#8217;s in the designated language.</td>
<td width="20%">all</td>
</tr>
</table>
<p>The first four pseudo classes are typically used on links, even though 3rd  and 4th apply to elements in general. This is because in IE (as of IE6),  &#8220;:hover&#8221; and &#8220;:active&#8221; don&#8217;t work on elements other than links.</p>
<p><span id="more-9"></span><strong>CSS Example #1 (link pseudo-classes):</strong></p>
<pre lang="css">
A:link    { color: red }     /* unvisited links */
A:visited { color: blue }   /* visited links   */
A:hover   { background-color: yellow } /* user hovers over link*/
A:active  { color: lime }   /* active links    */</pre>
<p>This is a very common CSS definition to manipulate the look of links on the  page. The order in which you define the four selectors is important, typically  known as <strong>LVHA</strong> (link visited hover active). If you alter the order, some  of your selectors will be suppressed and not take effect due to the way CSS  handles cascade/ ordering.</p>
<p><strong>CSS Example #2 (:first-child pseudo-class):</strong></p>
<pre lang="css">img:first-child{ border: 1px solid gray; }</pre>
<p>This applies a border to any image that is the first child of another  element.</p>
<p><strong>CSS Example #3 (:lang pseudo-class):</strong></p>
<pre lang="css">:lang(fr) { font-weight: bold; }</pre>
<p>This gives elements that are determined by the browser as French (using a  variety of methods) a bold font.</p>
<p>Source: http://www.dynamicdrive.com/style/csslibrary/item/css-pseudo-classes/</p>
<img src="http://www.office-it.org/?ak_action=api_record_view&id=9&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.office-it.org/css-pseudo-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

