<?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>Blog - ShiftEleven &#187; HTML &amp; CSS</title>
	<atom:link href="http://shifteleven.com/articles/category/html-css/feed" rel="self" type="application/rss+xml" />
	<link>http://shifteleven.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sat, 19 Sep 2009 11:19:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0-alpha</generator>
		<item>
		<title>Safari 3.0 and the Submit Button</title>
		<link>http://shifteleven.com/articles/2007/06/12/safari-30-and-the-submit-button</link>
		<comments>http://shifteleven.com/articles/2007/06/12/safari-30-and-the-submit-button#comments</comments>
		<pubDate>Wed, 13 Jun 2007 00:07:45 +0000</pubDate>
		<dc:creator>K. Adam Christensen</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[safari]]></category>

		<guid isPermaLink="false">http://dev.fecalrod.com/articles/2007/06/12/safari-30-and-the-submit-button</guid>
		<description><![CDATA[Safari has come out with their public beta and every is excited because the browser is now available for Windows XP/Vista; but there is also a beta available for Mac users.
So I downloaded it and I started to use it.  I love the ability to resize text areas and there is a Web Inspector [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.apple.com/safari/">Safari</a> has come out with their public beta and every is excited because the browser is now available for Windows XP/Vista; but there is also a beta available for Mac users.</p>
<p>So I downloaded it and I started to use it.  I love the ability to resize text areas and there is a Web Inspector (only for OS X) that allows you to see what properties are available to HTML nodes and their styles.</p>
<p>So I was using it and I noticed something: <strong>Safari now styles submit buttons</strong>.  Do you remember that aqua button that you could never do anything to?  Well now it responds to border stylings and the like.  Interesting.</p>
]]></content:encoded>
			<wfw:commentRss>http://shifteleven.com/articles/2007/06/12/safari-30-and-the-submit-button/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mimicking the :hover Pseudo-class in IE</title>
		<link>http://shifteleven.com/articles/2006/12/14/mimicking-the-hover-pseudo-class-in-ie</link>
		<comments>http://shifteleven.com/articles/2006/12/14/mimicking-the-hover-pseudo-class-in-ie#comments</comments>
		<pubDate>Thu, 14 Dec 2006 21:30:37 +0000</pubDate>
		<dc:creator>K. Adam Christensen</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[pseudo-class]]></category>
		<category><![CDATA[suckerfish]]></category>

		<guid isPermaLink="false">http://dev.fecalrod.com/?p=21</guid>
		<description><![CDATA[Internet Explorer frustrates the living hell out of me.  Event though IE 7 is finally out, it doesn&#8217;t mean that IE 6 can be ignored.  I really look forward to the day when my CSS(cascading style sheet) files aren&#8217;t full of unnecessary classes and hacks because the major browser vendors got it right [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.ie7.com/">Internet Explorer</a> frustrates the living hell out of me.  Event though IE 7 is finally out, it doesn&#8217;t mean that IE 6 can be ignored.  I really look forward to the day when my CSS(cascading style sheet) files aren&#8217;t full of unnecessary classes and hacks because the major browser vendors got it right and because everyone has casted away the garbage.  Until then, I am still in search of tricks to simplifying my life.</p>
<p>One of these tricks is to make IE pretend like it knows how to use the <code>:hover</code> pseudo-class on all tags.</p>
<p>If you have ever tried to do a <a href="http://alistapart.com/articles/dropdowns/,">suckerfish dropdown</a> then you have gone through the same thing:  excitement as you have learned how to use structural markup to create a dropdown and then frustration as your work has been nullified by IE.  The fix involves creating duplicate <a href="http://css.maxdesign.com.au/selectutorial/">selectors</a> of those using <code>:hover</code>, but instead of using <code>:hover</code>, replace it with a class name <code>.hover</code>.  Making what are essentially duplicates and managing more content doesn&#8217;t sit well with me.  The other trick to getting suckerfish to work in IE is to use JavaScript.  The script will add a class definition to the tag when a user&#8217;s mouse if over the element and then removes the class when the users mouse is no longer over it.  Since this method uses JavaScript to solve one problem, why not make it solve both?</p>
<p><span id="more-21"></span></p>
<h3>The Code</h3>
<p>There is a requirement to using this code and that is you will need <a href="http://prototype.conio.net/.">prototype 1.5</a></p>
<pre class="javascript" title="code">var HoverBehavior = Class.create();
HoverBehavior.prototype = {
  initialize: function() {
    $A(document.styleSheets).each( function(stylesheet) {
      $A(stylesheet.rules).each( function(rule) {
        if( rule.selectorText.match(/:hover/i) ) {
          stylesheet.addRule( rule.selectorText.replace(/:hover/ig, '.hover'), rule.style.cssText );
        }
      });
    });

    $A(arguments).each( function(arg) {
      $$(arg).each( function(tag) {
        Event.observe(tag, 'mouseover', function() { Element.addClassName(tag, 'hover'); });
        Event.observe(tag, 'mouseout', function() { Element.removeClassName(tag, 'hover'); });
      });
    });
  }
};</pre>
<p>In summary, it loops through all of the <a href="http://www.javascriptkit.com/domref/stylesheet.shtml,">stylesheets</a> and for each stylesheet, it loops through all of the rules.  The first part of the initialization will only work in IE.  When looping through the rules, IE uses the <code>rules</code> attribute while others use <code>cssRules</code>.  Since this is only meant for IE, I am not going to bother making it cross-browser.</p>
<p>While looping through all of the rules, it is checking the selector text to see if <code>:hover</code> is in that text.  If so it will append a new CSS rule to the stylesheet.  The selector text for that rule is just like text of the matched selector; however, all instances of <code>:hover</code> have been replaced with <code>.hover</code>.  The new rule&#8217;s style is simply a copy of the matched selector.</p>
<p>That covers part 1 of the suckerfish fix, part 2 is to add the mouseover, mouseout states to the tags using <code>:hover</code>.</p>
<h3>Usage</h3>
<p><strong>After the page has been loaded</strong>, then it is time to create a new instance of the HoverBehavior class.  Since this is only for IE, it would be wise to use <a href="http://www.javascriptkit.com/howto/cc2.shtml">IE conditionals</a> as that your other users, who are using complaint browsers, shouldn&#8217;t have to process any unnecessary code.</p>
<pre class="html" title="code">&lt;!--[if lt IE 7]&gt;
&lt;script type="text/javascript" charset="utf-8"&gt;
//&lt;![CDATA[
  new HoverBehavior('li');
//]]&gt;
&lt;/script&gt;
&lt;![endif]--&gt;</pre>
<p>The constructor can take any number of arguments that you would give to prototype&#8217;s <code>$$</code> function, which are like CSS selectors themselves.  I could have also done something like:</p>
<ul>
<li> <code>new HoverBehavior('#nav li', '#footer li');</code></li>
<li><code>new HoverBehavior('li', 'p', 'span');</code></li>
<li> <code>new HoverBehavior('*');</code></li>
</ul>
<p>The reason I don&#8217;t assume the last one in that list is because I don&#8217;t want to kill the user&#8217;s browser.  Instead of being lazy and choosing all of the elements, I only want to put the <code>mouseover</code>, <code>mouseout</code> functionality on the elements that need it.</p>
]]></content:encoded>
			<wfw:commentRss>http://shifteleven.com/articles/2006/12/14/mimicking-the-hover-pseudo-class-in-ie/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Why Microsoft Expression Web redefines irony</title>
		<link>http://shifteleven.com/articles/2006/11/16/why-microsoft-expression-web-redefines-irony</link>
		<comments>http://shifteleven.com/articles/2006/11/16/why-microsoft-expression-web-redefines-irony#comments</comments>
		<pubDate>Thu, 16 Nov 2006 17:15:27 +0000</pubDate>
		<dc:creator>Jarrod Spillers</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[expression web]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[wysiwyg]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://dev.fecalrod.com/articles/2006/11/16/why-microsoft-expression-web-redefines-irony</guid>
		<description><![CDATA[Expression is Microsoft&#8217;s suite of web development tools slated to replace the wonderful application known as Front Page.  A quick visit to the site for this tool yields a fairly typical Microsoft webpage.
The &#8220;web&#8221; edition of this tool makes some hefty claims concerning creating valid xhtml/css based layouts. A normal person would reasonably expect [...]]]></description>
			<content:encoded><![CDATA[<p>Expression is Microsoft&#8217;s suite of web development tools slated to replace the wonderful application known as Front Page.  A quick visit to the site for this tool yields a fairly typical Microsoft webpage.</p>
<p>The &#8220;<a href="http://www.microsoft.com/products/expression/en/web_designer/default.mspx">web</a>&#8221; edition of this tool makes some hefty claims concerning creating valid xhtml/css based layouts. A normal person would reasonably expect a webpage promoting a tool used for webpage creation would most likely be built with the said tool. This would demonstrate the level of quality, the level of EXCELLENCE made possible by purchasing and using it.</p>
<p>Let&#8217;s have a look&#8230;</p>
<p>First we use a little browser called <a href="http://www.mozilla.com/en-US/firefox/">Firefox</a> and a plugin called <a href="https://addons.mozilla.org/firefox/60/">web developer</a> to examine the layout of this page. By turning off CSS rendering we can examine the structure and determine how the creators approached the design process.</p>
<p>We clearly see that the developers of the expression site have chosen to use a table based, transitional approach (tables for the main layout, css to move things around within the columns). Well ok, I would have expected them to show off the &#8220;css layout&#8221; capabilities of the tool a bit more, but this in and of itself is still an acceptable practice.</p>
<p>With Expression web you can: &#8220;Validate your site with Compatibility reporting and use the Accessibility report to verify your site against Section 508 and W3C Content Accessibility Guidelines (WCAG).&#8221;</p>
<p>Well ok &#8211; let&#8217;s do some of that to the <a href="http://www.microsoft.com/products/expression/en/web_designer/wd_features.mspx">Expression Web &#8220;features&#8221;</a> page and see what we get! (using Firefox&#8217;s handy developer tools of course).</p>
<p><strong>WHOA!</strong> Did they not even listen to their own marketing garbage? 144 Errors! No DocType? Are you kidding me?</p>
<p>The validation report is littered with opening tags that are never closed, closing tags that were never opened, several tags that are not part of ANY of the w3 HTML specifications, dozens of properties on tags that are also not part of any specification, Don&#8217;t believe me &#8211; <a href="http://validator.w3.org/check?verbose=1&#038;uri=http%3A%2F%2Fwww.microsoft.com%2Fproducts%2Fexpression%2Fen%2Fweb_designer%2Fwd_features.mspx">see for yourself</a></p>
<p>Bravo to our good friends at Microsoft for setting such a great example and leading the masses to a more standards compliant internet! (and for giving web standards geeks something to hate on)</p>
]]></content:encoded>
			<wfw:commentRss>http://shifteleven.com/articles/2006/11/16/why-microsoft-expression-web-redefines-irony/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
