<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/1.5" -->
<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/"
>

<channel>
	<title>Webmaster Kit</title>
	<link>http://www.webmaster-kit.com</link>
	<description>CSS, JavaScript, PHP, Perl, XML and much more...</description>
	<pubDate>Thu, 21 Apr 2005 09:28:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=1.5</generator>
	<language>en</language>

		<item>
		<title>CSS2 Browser Compatibility</title>
		<link>http://www.webmaster-kit.com/2005/04/21/css2-browser-compatibility/</link>
		<comments>http://www.webmaster-kit.com/2005/04/21/css2-browser-compatibility/#comments</comments>
		<pubDate>Thu, 21 Apr 2005 01:05:08 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>CSS</category>
		<guid>http://www.webmaster-kit.com/2005/04/21/css2-browser-compatibility/</guid>
		<description><![CDATA[CSS2 specification opens new opportunities for web developers but before applying new features webmaster should know how popular browsers support them.



Descendant selectors
Syntax:
E1 E2 
The following rule should set the font-style of all P elements that occurs anywhere within a PRE:

CSS code:

pre  p {font-style: italic;}

HTML code:

&lt;pre&gt;

&lt;p&gt;This text should be italic style&lt;/p&gt;

&lt;div&gt;

 &lt;p&gt;This text should be [...]]]></description>
			<content:encoded><![CDATA[	<p>CSS2 specification opens new opportunities for web developers but before applying new features webmaster should know how popular browsers support them.</p>
	<p><a id="more-6"></a></p>
	<h3>Descendant selectors</h3>
	<p><strong>Syntax:</strong></p>
	<p>E1 E2<br />
The following rule should set the font-style of all P elements that occurs anywhere within a PRE:</p>
	<p><strong>CSS code:</strong></p>
	<pre>
pre  p {font-style: italic;}
</pre>
	<p><strong>HTML code:</strong></p>
	<pre>
&lt;pre&gt;
	
&lt;p&gt;This text should be italic style&lt;/p&gt;
	
&lt;div&gt;
	
 &lt;p&gt;This text should be italic style too&lt;/p&gt;
	
&lt;/div&gt;
	
&lt;/pre&gt;
</pre>
	<p>IE 6.0 and Firefox 1.0.1 display the same correct result. </p>
	<h3>Child selectors</h3>
	<p><strong>Syntax:</strong></p>
	<p>E1 &gt; E2 </p>
	<p>A child selector matches when an element is the child of some element.</p>
	<p>The following rule should set the font-style of all P elements that are children of DIV:</p>
	<p><strong>CSS code:</strong></p>
	<pre>
pre &gt; p {font-style: italic;}
</pre>
	<p><strong>HTML code:</strong></p>
	<pre>
&lt;pre&gt;
	
&lt;p&gt;This text should be italic style&lt;/p&gt;
	
&lt;div&gt;
	
 &lt;p&gt;This text should NOT be italic style&lt;/p&gt;
	
&lt;/div&gt;
	
&lt;/pre&gt;
</pre>
	<table bgcolor=#7895AF>
	<tr>
<td bgcolor=#C6D3E3><center><strong>Screenshots:</strong></center></td>
</tr>
	<tr>
	<td><center><strong>FF 1.0.1</strong></center></td>
	</tr>
	<tr>
	<td><img src="/samples/ff-002.gif" width="300" height="140" border="1"/></td>
	</tr>
	<tr>
	<td><center><strong>IE 6.0</strong></center></td>
	</tr>
	<tr>
	<td><img src="/samples/ie-002.gif" width="300" height="140" border="1"/></td>
	</tr>
	</table>
	<p>IE 6.0 <strong>doesn&#8217;t</strong> support the child selectors. FireFox 1.0.1 displays the text according to CSS2 specification.</p>
	<h3>Adjacent sibling selectors</h3>
	<p><strong>Syntax:</strong></p>
	<p>E1 + E2</p>
	<p>The selector matches if E1 and E2 share the same parent in the document tree and E1 immediately precedes E2.</p>
	<p><strong>CSS code:</strong></p>
	<pre>
pre + p {text-transform: uppercase;}
</pre>
	<p><strong>HTML code:</strong></p>
	<pre>
&lt;pre&gt;
	
&lt;p&gt; Adjacent sibling selectors &lt;/p&gt;
	
&lt;/pre&gt;
	
&lt;p&gt; This text should be upper case &lt;/p&gt;
</pre>
	<table bgcolor=#7895AF>
	<tr>
<td bgcolor=#C6D3E3><center><strong>Screenshots:</strong></center></td>
</tr>
	<tr>
	<td><center><strong>FF 1.0.1</strong></center></td>
	</tr>
	<tr>
	<td><img src="/samples/ff-003.gif" width="300" height="140" border="1"/></td>
	</tr>
	<tr>
	<td><center><strong>IE 6.0</strong></center></td>
	</tr>
	<tr>
	<td><img src="/samples/ie-003.gif" width="300" height="140" border="1"/></td>
	</tr>
	</table>
	<p>IE 6.0 <strong>doesn&#8217;t</strong> support the adjacent sibling selectors. FireFox 1.0.1 displays the text according to CSS2 specification.</p>
	<h3>Attribute selectors</h3>
	<p>CSS2 allows authors to specify rules that match attributes defined in the source document.</p>
	<p><strong>CSS code:</strong></p>
	<pre>
a[rel] { background-color: grey; }
	
a[rel=nofollow] { background-color: yellow; }
	
a[title~=\"selectors\"] { background-color: red; }
	
a[title|=\"css\"] { background-color: green; }
</pre>
	<p><strong>HTML code:</strong></p>
	<pre>
&lt;p&gt;&lt;a rel=\"copyright\" href=\"\"&gt;&copy;2005 SafeSoft&lt;/a&gt;
- This link should have grey background&lt;/p&gt;
	
&lt;p&gt;&lt;a rel=\"nofollow\" href=\"\"&gt;Google&lt;/a&gt;&nbsp;
- This link should have yellow background&lt;/p&gt;
	
&lt;p&gt;&lt;a title=\"Attribute selectors\" href=\"\"&gt;Attribute selectors&lt;/a&gt;&nbsp;
- This link should have red background&lt;/p&gt;
	
&lt;p&gt;&lt;a title=\"css-compatibility\" \"&gt;CSS Browser Compatibility&lt;/a&gt;&nbsp;
- This link should have green background&lt;/p&gt;
</pre>
	<table bgcolor=#7895AF>
	<tr>
<td bgcolor=#C6D3E3><center><strong>Screenshots:</strong></center></td>
</tr>
	<tr>
	<td><center><strong>FF 1.0.1</strong></center></td>
	</tr>
	<tr>
	<td><img src="/samples/ff-004.gif" width="400" height="140" border="1"/></td>
	</tr>
	<tr>
</tr>
	<tr>
	<td><center><strong>IE 6.0</strong></center></td>
	</tr>
	<td><img src="/samples/ie-004.gif" width="400" height="140" border="1"/></td>
	</table>
	<p>IE 6.0 <strong>doesn&#8217;t</strong> support the attribute selectors. FireFox 1.0.1 displays the text according to CSS2 specification.</p>
	<h3>ID selectors</h3>
	<p>CSS ID selectors match an element instance based on its identifier. A CSS ID selector contains a &#8220;#&#8221; immediately followed by the ID value.</p>
	<p><strong>CSS code:</strong></p>
	<pre>
h2#m01 {color : blue;}
</pre>
	<p><strong>HTML code:</strong></p>
	<pre>
&lt;h2 id=m01&gt;ID selectors&lt;/h2&gt;
</pre>
	<p>IE 6.0 and Firefox 1.0.1 display the text according to CSS2 specification.</p>
	<h3>Pseudo-classes</h3>
	<h4>:first-child pseudo-class</h4>
	<p>The :first-child pseudo-class matches an element that is the first child element of some other element.</p>
	<p><strong>CSS code:</strong></p>
	<pre>
div p:first-child strong {color : blue}
</pre>
	<p><strong>HTML code:</strong></p>
	<pre>
&lt;div&gt;
	
&lt;p&gt;&lt;strong&gt;:first-child&lt;/strong&gt;  should be black blue&lt;p&gt;
	
&lt;p&gt;&lt;strong&gt;second&lt;/strong&gt; paragraph should be black&lt;p&gt;
	
&lt;/div&gt;
</pre>
	<table bgcolor=#7895AF>
	<tr>
<td bgcolor=#C6D3E3><center><strong>Screenshots:</strong></center></td>
</tr>
	<tr>
	<td><center><strong>FF 1.0.1</strong></center></td>
	</tr>
	<tr>
	<td><img src="/samples/ff-006.gif" width="300" height="140" border="1"/></td>
	</tr>
	<tr>
	<td><center><strong>IE 6.0</strong></center></td>
	</tr>
	<tr>
	<td><img src="/samples/ie-006.gif" width="300" height="140" border="1"/></td>
	</tr>
	</table>
	<p>IE 6.0 <strong>doesn&#8217;t</strong> support the :first-child pseudo-class. FireFox 1.0.1 displays the text according to CSS2 specification.</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.webmaster-kit.com/2005/04/21/css2-browser-compatibility/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>Sheet of Paper</title>
		<link>http://www.webmaster-kit.com/2005/04/06/sheet-of-paper/</link>
		<comments>http://www.webmaster-kit.com/2005/04/06/sheet-of-paper/#comments</comments>
		<pubDate>Wed, 06 Apr 2005 20:50:13 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Craphics</category>
		<guid>http://www.webmaster-kit.com/2005/04/06/sheet-of-paper/</guid>
		<description><![CDATA[Photoshop tutorial - how to create a sheet of paper.

Create new file and set the file size about 20 x 20 pixels. It should be in RGB mode. 

Set maximum zoom 1600% (Ctrl + + several times) 
By means of pencil tool draw the sheet borders

Draw right angle

Make selection with Magic Wand,  fill selection [...]]]></description>
			<content:encoded><![CDATA[	<h3>Photoshop tutorial - how to create a sheet of paper.</h3>
	<p><a id="more-5"></a></p>
	<ol>
<li>Create new file and set the file size about 20 x 20 pixels. It should be in <code>RGB mode</code>.<br />
<img src="/photoshop/sheetofpaper/001.gif" alt="Screen #1" />
</li>
	<li>Set maximum zoom 1600% (<code>Ctrl + + </code>several times)
</li>
	<li>By means of pencil tool draw the sheet borders<br />
<img src="/photoshop/sheetofpaper/002.gif" alt="Screen #2" />
</li>
	<li>Draw right angle<br />
<img src="/photoshop/sheetofpaper/003.gif" alt="Screen #3" />
</li>
	<li>Make selection with Magic Wand,  fill selection with white color. When filling be sure that anti-aliased combo is unchecked.<br />
<img src="/photoshop/sheetofpaper/004.gif" alt="Screen #4" />
</li>
	<li>Apply the same actions to right angle but use grey color for filling. After using pencil with grey color try make something similar.<br />
<img src="/photoshop/sheetofpaper/006.gif" alt="Screen #5" />
</li>
	<li>Crop the canvas and save file for web (<code>Alt + Shift + Ctlr + S</code>) in <code> gif</code> format.</li>
	<p><img src="/photoshop/sheetofpaper/007.gif" alt="Sheet of Paper" />
</ol>
]]></content:encoded>
			<wfw:commentRSS>http://www.webmaster-kit.com/2005/04/06/sheet-of-paper/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>Pseudo-links</title>
		<link>http://www.webmaster-kit.com/2005/04/01/pseudo-links/</link>
		<comments>http://www.webmaster-kit.com/2005/04/01/pseudo-links/#comments</comments>
		<pubDate>Fri, 01 Apr 2005 12:45:57 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>JavaScripts</category>
		<guid>http://www.webmaster-kit.com/2005/04/01/pseudo-links/</guid>
		<description><![CDATA[Using DOM for pseudo-links realization.

The first of all it’s necessary to create CSS classes describing our elements

Selector “u” is used for definition of default properties. Selector “u.ov” determines behavior of the element when Mouse Over event and third selector is used when Mouse Out event occurs.




&lt;style type=&quot;text/css&quot;&gt;

     u  {
  [...]]]></description>
			<content:encoded><![CDATA[	<h3>Using DOM for pseudo-links realization.</h3>
	<p>The first of all it’s necessary to create CSS classes describing our elements</p>
	<p>Selector <code>“u”</code> is used for definition of default properties. Selector <code>“u.ov”</code> determines behavior of the element when <code>Mouse Over event</code> and third selector is used when <code>Mouse Out</code> event occurs.</p>
	<p><a id="more-4"></a></p>
	<pre>
&lt;style type=&quot;text/css&quot;&gt;
	
     u  {
          color : #0000cc;
      }
     u.ov {
          color : #3333ff;
          cursor : pointer;
      }
     u.ou {
          color : #0000cc;
      }
	
&lt;/style&gt;
</pre>
	<p>The function <code>setClassName()</code> is used for dynamic CSS class setting. This function determines a browser and set CSS class to element.</p>
	<p>The function <code>dohref()</code> gets the element collection and sets them event handlers.</p>
	<p>Attribute ID contains the number which should be associated with element of the array<code> arUrl[]</code>. </p>
	<pre>
&lt;script language=&quot;javascript&quot;&gt;
	
onload = dohref;
	
function setClassName( element, className) {
  agt = navigator.userAgent.toLowerCase();
  if (agt.indexOf('mozilla')!=-1 &#038;&#038; agt.indexOf('spoofer')==-1 &#038;&#038; agt.indexOf('compatible') == -1)
    element.setAttribute(&quot;class&quot;, className);
  else
    element.setAttribute(&quot;className&quot;, className);
}
	
function dohref() {
  if (!document.getElementById) return
  var aarr = document.getElementsByTagName('u');
  for (var i = 0; i &lt; aarr.length; i++) {
    if (aarr[i].getAttribute('id')) {
		aarr[i].onmouseover = function() {
         setClassName(this, 'ov');
        }
		aarr[i].onmouseout = function() {
		 setClassName(this, 'ou');
        }
        aarr[i].onclick = function() {
		var strU = this.getAttribute('id');
		document.location = arUrl[strU.substring(1,strU.length)];
        }
    }
  }
}
	
var arUrl = new Array(3);
	
arUrl[0] = &quot;http://www.google.com&quot;;
arUrl[1] = &quot;http://www.yahoo.com&quot;;
arUrl[2] = &quot;http://www.dmoz.org&quot;;
	
&lt;/script&gt;
</pre>
	<p><a href="http://webmaster-kit.com/jsdom.html">Working demo</a>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.webmaster-kit.com/2005/04/01/pseudo-links/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>HTML Colors</title>
		<link>http://www.webmaster-kit.com/2005/04/01/web-color-kit/</link>
		<comments>http://www.webmaster-kit.com/2005/04/01/web-color-kit/#comments</comments>
		<pubDate>Fri, 01 Apr 2005 12:42:58 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>CSS</category>
		<guid>http://www.webmaster-kit.com/2005/04/01/web-color-kit/</guid>
		<description><![CDATA[Color Modes


Most personal computers ( PCs ) offer a choice of settings for screen size and color depth. The amount of memory available to drive the display is fixed, but users can choose a large screen size ( resolution ) with a reduced number of colors, or a smaller screen size with the maximum number [...]]]></description>
			<content:encoded><![CDATA[	<h3>Color Modes</h3>
	<dl>
	<dd>Most personal computers ( PCs ) offer a choice of settings for screen size and color depth. The amount of memory available to drive the display is fixed, but users can choose a large screen size ( resolution ) with a reduced number of colors, or a smaller screen size with the maximum number of colors.</dd>
	<p><a id="more-3"></a></p>
	<dd>The table on the right shows the choice of color modes and resolutions which might be found on a low-specification PC. The table below shows the standard range of color modes. Note that 32 bit color mode doesn&#8217;t increase the number of colors available, but it does allow video memory to be updated faster.</p>
	</dd>
	</dl>
	<dl>
	<dd>
	<table class="tbl" cellspacing="0" cellpadding="5" bgcolor="#CCCCFF">
	<tr bgcolor="#003366">
	<td><strong><font color="#ffffff">Maximum colors</font></strong></td>
	<td><strong><font color="#ffffff">Bits per pixel</font></strong></td>
	<td><strong><font color="#ffffff">Comments</font></strong></td>
	</tr>
	<tr>
	<td>16</td>
	<td>4 bit</td>
	<td>Virtually obsolete</td>
	</tr>
	<tr>
	<td>256</td>
	<td>8 bit</td>
	<td>216 web-safe colors</td>
	</tr>
	<tr>
	<td>65 536</td>
	<td>16 bit</td>
	<td>High Color</td>
	</tr>
	<tr>
	<td>16 777 216</td>
	<td>24 bit</td>
	<td>True Color</td>
	</tr>
	<tr>
	<td>16 777 216</td>
	<td>32 bit</td>
	<td>True Color</td>
	</tr>
	</table>
	</dd>
	</dl>
	<h3>Web Safe Colors</h3>
	<dl>
	<dd>A few years ago, when most computers supported only 256 different colors, a list of 216 Web Safe Colors was suggested as a Web standard. The reason for this was that Microsoft and Mac operating system used 40 different &#8220;reserved&#8221; fixed system colors (about 20 each).</dd>
	<dd>We are not sure how important this is now, since more and more computers are equipped with the ability to display millions of different colors, but the choice is left to you.</dd>
	</dl>
	<h3>216 Cross Platform Colors</h3>
	<dl>
	<dd>The color management system currently used by Web browser software is based on an 8-bit, 216-color (not 256) palette. The browser-safe color palette is a solution devised by Netscape to solve the problem of displaying color graphics in a similar way on many kinds of display screens, with browsers running under different operating systems (such as Macintosh, Windows, and UNIX). Because a majority of the Web audience years ago had 8-bit display screens, 256 colors was the upper limit for the color palette. But the various versions of the Windows operating system (which currently represent about 95 percent of the microcomputer market) reserve 40 colors for displaying such graphic interface elements as windows, menus, screen wallpaper, icons, and buttons, which leaves just 216 colors to display everything else. The 216 colors chosen by Netscape are identical in both the Macintosh and Windows system palettes. Although the browser-safe color scheme originated at Netscape, at present both of the dominant Web browsers (Netscape Navigator and Microsoft Internet Explorer) use the same color management system.</dd>
	<dd>Most Web users have computers and monitors set to &#8220;thousands&#8221; or &#8220;millions&#8221; of colors, so the importance of the so-called Web-safe palette has sharply diminished in the past few years. When the user has a monitor set to thousands or millions of colors all colors display properly, so there is no longer any need to restrict your color choices to the 216 Web-safe colors.</dd>
	</dl>
	<p><img src="/images/colors.gif" alt="216 Web-safe colors" />
</p>
]]></content:encoded>
			<wfw:commentRSS>http://www.webmaster-kit.com/2005/04/01/web-color-kit/feed/</wfw:commentRSS>
	</item>
		<item>
		<title>Referrer Spam</title>
		<link>http://www.webmaster-kit.com/2005/04/01/referrer-spam/</link>
		<comments>http://www.webmaster-kit.com/2005/04/01/referrer-spam/#comments</comments>
		<pubDate>Fri, 01 Apr 2005 12:26:34 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Anti-Spam</category>
		<guid>http://www.webmaster-kit.com/2005/04/01/referrer-spam/</guid>
		<description><![CDATA[Turing test stops spam
As a rule, spammers use special programs - bots-that automatically look for vulnerable sites and spam them with hundreds of links. There are several ways to prevent spam attacks of the kind. Here is one of them. First of all, we must protect our site from spam-bots to guarantee that it is [...]]]></description>
			<content:encoded><![CDATA[	<h3>Turing test stops spam</h3>
	<p>As a rule, spammers use special programs - bots-that automatically look for vulnerable sites and spam them with hundreds of links. There are several ways to prevent spam attacks of the kind. Here is one of them. First of all, we must protect our site from spam-bots to guarantee that it is real people that leave messages and comments.</p>
	<p><a id="more-2"></a></p>
	<p>I recommend using Turing test for protection against spam-bots. It&#8217;s needed to install a script that will generate random numbers and show them as images. After this site visitors will enter this number in a special field for comparison. The thing is that bots can not read the text on the images.</p>
	<h3>button.php</h3>
	<pre>
&lt;?php
	
$image = imagecreate(120, 30);
	
$white    = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$gray    = imagecolorallocate($image, 0xC0, 0xC0, 0xC0);
$darkgray = imagecolorallocate($image, 0x50, 0x50, 0x50);
	
srand((double)microtime()*1000000);
	
/*
 * Print the random grey lines
*/
	
for ($i = 0; $i &lt; 30; $i++) {
  $x1 = rand(0,120);
  $y1 = rand(0,30);
  $x2 = rand(0,120);
  $y2 = rand(0,30);
  imageline($image, $x1, $y1, $x2, $y2 , $gray);
}
	
/*
 * Fill array $cnum with random numbers
*/
	
for ($i = 0; $i &lt; 5; $i++) {
$cnum[$i] = rand(0,9);
}
	
/*
 * Print random dark grey numbers from $cnum
*/
	
for ($i = 0; $i &lt; 5; $i++) {
 $fnt = rand(3,5);
 $x = $x + rand(12 , 20);
 $y = rand(7 , 12);
 imagestring($image, $fnt, $x, $y, $cnum[$i] , $darkgray);
}
	
/*
 * Assemble random digits form array to single whole number
*/
	
$digit = \"$cnum[0]$cnum[1]$cnum[2]$cnum[3]$cnum[4]\";
	
/*
 * Start new session
*/
	
session_start();
$_SESSION['digit'] = $digit;
	
/*
 * Print image header
*/
	
header('Content-type: image/png');
imagepng($image);
imagedestroy($image);
	
?&gt;
</pre>
	<p><b>button.php</b> should be used for image source.</p>
	<pre>&lt;img width=120 height=30 src=\"button.php\" border=\"1\"&gt;</pre>
	<h3>audit.php</h3>
	<pre>
&lt;?php
 function audit() {
  session_start();
	
/*
 * Read the session variable
*/
	
  $digit = $_SESSION['digit'];
	
/*
 * Read the user entered numbers
*/
	
  $userdigit = $_POST['userdigit'];
	
/*
 * Destroy the session
*/  
	
  session_destroy();   
	
/*
 * Compare the numbers
*/ 
	
  if ($digit == $userdigit) {
    return true;
  } else {
    return false;
  }
	
}
?&gt;
</pre>
	<h3>Scripts implantation</h3>
	<pre>
&lt;form action=\"frm.php\" METHOD=\"POST\"&gt;
	
&lt;img width=120 height=30 src=\"<b>button.php</b>&#8221; border=&#8221;1&#8243;&gt;
&lt;br&gt;
&lt;input MAXLENGTH=5 SIZE=5 name=&#8221;userdigit&#8221; type=&#8221;text&#8221; value=&#8221;\"&gt;
&lt;br&gt;
&lt;input type=&#8221;submit&#8221;&gt;
&lt;/form&gt;
</pre>
	<p>In action script you can use following code: </p>
	<h3>frm.php</h3>
	<pre>
&lt;?php
 include \"audit.php\";
 if (audit()) {
  echo \"Passed...\";
 }
?&gt;
</pre>
	<p>The function <b>audit()</b> returns &#8220;true&#8221; if the number entered by the visitor coincides with the number on the image, and returns “false” in other cases. </p>
	<p>Working sample can be found <a href="http://php.webmaster-kit.com/audit.html">here</a></p>
]]></content:encoded>
			<wfw:commentRSS>http://www.webmaster-kit.com/2005/04/01/referrer-spam/feed/</wfw:commentRSS>
	</item>
	</channel>
</rss>
