<?xml version="1.0" encoding="iso-8859-1" ?>
<rss version="2.0">
<channel>
<title>NealGrosskopf.com - Geek Speak</title>
<link>http://www.nealgrosskopf.com/tech/</link>
<description>a NG Designs Website...</description>
<language>en-us</language>
<copyright>Copyright &#169; 2008 NealGrosskopf.com</copyright>
<lastBuildDate>Fri, 6 Jan 2009 16:14:34 CST</lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator>NealGrosskopf.com RSS Generator</generator>
<managingEditor>Neal Grosskopf</managingEditor>
<webMaster>Neal Grosskopf</webMaster>
<image>
<title>NealGrosskopf.com</title>
<url>http://www.nealgrosskopf.com/files/ico/favicon_32.png</url>
<link>http://www.nealgrosskopf.com</link>
</image>
<item>
<title>Always Show Scrollbars In Firefox Using CSS</title>
<link>http://www.nealgrosskopf.com/tech/thread.asp?pid=12</link>
<description>
<![CDATA[
<p>I remember the first time I used Firefox I was extremely annoyed by the fact that the browser does not always show the scrollbars (like Internet Explorer does).
The problem with this is when a page's height is not greater than the available screen height and a users clicks a link to a page that is taller than the available screen height
it shifts the entire content area over to accommodate for the scrollbars (which probably take up 15 pixels or so). This is most likely the standards compliant way to display a page
and IE has been doing it wrong all along, regardless it is annoying seeing the web page jump back and forth in Firefox.</p>

<h4>The Solution:</h4>

<p>Fortunately there is a solution using CSS:</p>

<code>
html { overflow-y: scroll; }
</code>

<h4>The Opposite</h4>

<p>If the meaning of your life depends on not conforming to Microsoft (you're out there) you can also make IE behave like Firefox:</p>

<code>
html { overflow-y: auto; }
</code>

<p>Whatever method you prefer I would recommend placing this in your baseline stylesheet before starting a new web site or project. Your users will thank you.</p>

<h4>Sources:</h4>

<ul>
	<li><a href="http://webdevel.blogspot.com/2007/05/controlling-browser-scrollbars.html">Controlling browser scrollbars </a></li>
</ul><p><a href="http://www.nealgrosskopf.com/tech/thread.asp?pid=12">View Comments [1]</a><img src='http://www.nealgrosskopf.com/dev/beacon/image.asp?e=tech' height='1' width='1' /></p>]]>
</description>
<pubDate>Mon, 30 Apr 2008 20:06:46 CST</pubDate>
<guid>http://www.nealgrosskopf.com/tech/thread.asp?pid=12</guid>
<author>Neal Grosskopf</author>
<category>firefox</category><category>css</category><category>css3</category>
</item>
<item>
<title>Common JavaScript Functions</title>
<link>http://www.nealgrosskopf.com/tech/thread.asp?pid=11</link>
<description>
<![CDATA[
<p>Javascript libraries seem to be all the vogue now days. Unfortunately many of them are becoming bloated with features and are growing larger than
50KB. Some developers may only use 10% of the libraries features too. One of the more common features is the dollar sign function i.e. $('element').
Of course I am a bit biased since I am a hardcore CSS person (thanks <a href="http://pagebuildr.com/jason">Jason</a>) so I shy away from JavaScript as much as possible. Over time I have found 
that JS is necessary and many times the only solution to some problems.</p>

<p>One thing you'll notice with JavaScript programming is the methods and property calls can get quite lengthy. There is a solution to this and that is to create
your own custom functions with shorter function names.</p>

<h4>Short Named JavaScript Functions:</h4>

<code>
function gd(e) { return document.getElementById(e); }
function gs(e) { return document.getElementById(e).style; }
function gv(e) { return document.getElementById(e).value; }
function dw(i) { return document.write(i); }
</code>

<p>Each of these is simply a shorter way of calling the built in JavaScript functions. By using these you can reduce the file size of of you JavaScript and also increase
the legibility. Probably the only con to these functions is there will be a performance decrease since the code will have to do an extra call each time it's used.</p>

<p>If you can think of any other down and dirty JS functions feel free to leave a comment and fill me in.</p>

<h4>Sources:</h4>

<ul>
	<li><a href="http://chrisretlich.com/">All credit goes to Chris Retlich</a></li>
</ul><p><a href="http://www.nealgrosskopf.com/tech/thread.asp?pid=11">View Comments [4]</a><img src='http://www.nealgrosskopf.com/dev/beacon/image.asp?e=tech' height='1' width='1' /></p>]]>
</description>
<pubDate>Sun, 29 Apr 2008 18:58:14 CST</pubDate>
<guid>http://www.nealgrosskopf.com/tech/thread.asp?pid=11</guid>
<author>Neal Grosskopf</author>
<category>javascript</category>
</item>
<item>
<title>Reverse Array in ASP</title>
<link>http://www.nealgrosskopf.com/tech/thread.asp?pid=10</link>
<description>
<![CDATA[
<p>A problem I've ran into numerous times when programming in ASP is that there is no easy way to reverse arrays. With my limited knowledge of other programming languages
I believe ASP is the minority of web languages that can't reverse or sort arrays with built in functions. I had also searched high and low on the web for a home brewed function
to do this but never had any luck.</p>

<p>Then the other day I ran across this nugget of an article.</p>

<h4>Reversing Arrays in ASP:</h4>

<ol>
<li>
Here we define our array. In most cases this is done from a database.
<code>
articlesRev = array( _
"array item 0", _
"array item 1", _
"array item 2", _
"array item 3" _
)
</code>
</li>

<li>
Next we loop through our original array and reverse it.
<code>
Dim articles()
ubnd = UBound(articlesRev)
Redim articles(ubnd)
for i = 0 to ubnd
 articles(ubnd - i) = articlesRev(i)
next
</code>
</li>

<li>
Finally we write out our array, which is reversed now.
<code>
for i=0 to ubound(articles)
 response.Write(articles(i)&"&lt;br&gt;")
next
</code>
</li>
</ol>

<h4>Putting It all together:</h4>

<code>
articlesRev = array( _
"array item 0", _
"array item 1", _
"array item 2", _
"array item 3" _
)

Dim articles()
ubnd = UBound(articlesRev)
Redim articles(ubnd)
for i = 0 to ubnd
 articles(ubnd - i) = articlesRev(i)
next

for i=0 to ubound(articles)
 response.Write(articles(i)&"&lt;br&gt;")
next
</code>

<h4>Sources:</h4>

<ul>
	<li><a href="http://www.cruto.com/blog/?p=4">http://www.cruto.com/blog/?p=4 </a></li>
</ul><p><a href="http://www.nealgrosskopf.com/tech/thread.asp?pid=10">View Comments [4]</a><img src='http://www.nealgrosskopf.com/dev/beacon/image.asp?e=tech' height='1' width='1' /></p>]]>
</description>
<pubDate>Sun, 15 Apr 2008 19:21:37 CST</pubDate>
<guid>http://www.nealgrosskopf.com/tech/thread.asp?pid=10</guid>
<author>Neal Grosskopf</author>
<category>asp</category>
</item>
<item>
<title>Embedding Flash Without Click To Activate Using Valid HTML</title>
<link>http://www.nealgrosskopf.com/tech/thread.asp?pid=9</link>
<description>
<![CDATA[
<p>I am currently working on a website for a client and one of their requests was that their home page have some animation featuring some of their promotions. Now I know the first thing you are saying is 
"please, God, say it aint so, not FLASH!" Yes I know flash is evil, I absolutely hate it but in this instance it is the best tool for the job.</p>

<p>I won't tell you how annoying the software is to make a flash movie but I will tell you how annoying it is to simply embed a flash file in your web page using valid HTML.</p>

<h4>Here is the jist of what I needed to accomplish:</h4>

<ol>
	<li>Valid HTML</li>	
	<li>A movie that doesn't repeat</li>
	<li>A movie with a clickable link/region</li>
	<li>A movie with a transparent background</li>
	<li>Avoid annoying "Click to activate this control" in Internet Explorer</li>
</ol>

<p>I was able to do these things but never a combination of all of them. I first tried using a javascript library called <a href="http://code.google.com/p/swfobject/">SWF Object</a> since that
is something I've seen on our work websites. SWF Object worked fine although it failed miserably with the transparent background. I tried pretty much everything I could think of to get that to work
even using examples from the documentation but to no avail it sucks.</p>

<p class="i">On a side note, people are seriously over-using these javscript libraries. Within a few years every legitimate web developer will have forgotten getElementById() and will assume that javascript can naturally select individual elements by class name with no problem.
I think libraries are the cheap way out, not to mention how many KB they take up. Check out one of my work <a href="http://www.ipsousa.com/">websites</a>. It has over 12 javascript files, clocking in at over 240KB. Gez.
</p>

<p>After that I tried simply hardcoding the html into the webpage. This worked fine in IE but Firefox and the likes required the noncompliant EMBED tag to make it work. Even worse was I was now
faced with the annoying Click to activate this control problem in Internet Explorer.</p>

<p>After various modifications to my code I ended up just taking the invalid EMBED tag wrapped with an OBJECT tag and through it in an external javascript file using multiple document.writes</p>

<p>Everything worked now, except the code technically wasn't valid HTML even though the W3C validator said so. Then today I read <a href="http://www.alistapart.com/articles/flashembedcagematch">this article</a> on Alistapart and specifically <a href="http://www.alistapart.com/comments/flashembedcagematch?page=3#29">this comment</a>.
After that it all made sense to me. After hours of toiling I had found the solution and everybody was wrong!</p>

<p>This code not only validates but it works. The only drawback here is we still have the annoying click to activate this control problem in Internet Explorer. The trick here was to remove the ClassID attribute since that stopped it from working in Firefox and adding the DATA attribute.</p>

<pre>
&lt;object type=&quot;application/x-shockwave-flash&quot; data=&quot;/yourfile.swf&quot;&gt;
&lt;param name=&quot;movie&quot; value=&quot;/yourfile.swf&quot;&gt;
&lt;param name=&quot;loop&quot; value=&quot;false&quot;&gt;
&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;
&lt;/object&gt;
</pre>

<h4>Embeding Flash Without Click To Active And Using Valid HTML</h4>

<p>Simply place this script in an external .JS file and call it using the bottom function. Viola, no more click to activate, transparent background, doesn't repeat, and work fine in all browsers without the stupid EMBED tag and without annoying
conditional comments for IE.</p>

<pre>
&lt;script type=&quot;text/javascript&quot;&gt;
function writeFlash(file)
{
document.write('&lt;object type=&quot;application/x-shockwave-flash&quot; data=&quot;'+file+'&quot;&gt;')
document.write('&lt;param name=&quot;movie&quot; value=&quot;'+file+'&quot;&gt;')
document.write('&lt;param name=&quot;loop&quot; value=&quot;false&quot;&gt;')
document.write('&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;')
document.write('&lt;/object&gt;')
}
&lt;/script&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
writeFlash(&quot;/yourfile.swf&quot;);
&lt;/script&gt;
</pre>

<h4>G00gle B0mb Attempts</h4>
<ul>
	<li><a href="http://www.alistapart.com/comments/flashembedcagematch?page=3#29">The answer</a></li>
	<li><a href="http://code.google.com/p/swfobject/">Doesn't completely work</a></li>
	<li><a href="http://www.alistapart.com/articles/flashembedcagematch">Not the right answer</a></li>
</ul><p><a href="http://www.nealgrosskopf.com/tech/thread.asp?pid=9">View Comments [2]</a><img src='http://www.nealgrosskopf.com/dev/beacon/image.asp?e=tech' height='1' width='1' /></p>]]>
</description>
<pubDate>Sat, 7 Apr 2008 18:24:0 CST</pubDate>
<guid>http://www.nealgrosskopf.com/tech/thread.asp?pid=9</guid>
<author>Neal Grosskopf</author>
<category>validation</category><category>flash</category><category>html</category>
</item>
<item>
<title>Using Media Targeting With CSS With @Media</title>
<link>http://www.nealgrosskopf.com/tech/thread.asp?pid=8</link>
<description>
<![CDATA[
<p>Recently I've been crafting my stylesheets a bit different than I had in the past. I discovered that using a stylesheet link with the media type of all (see below) you can embed other media types within your &quot;all&quot; stylesheet. Note many people are unsure of what to name their stylesheets and I choose to name it after the media type it is targeting or whether it is targeting Internet Explorer (ie6.css &amp; ie7.css etc)</p>

<code>
&lt;link rel="stylesheet" type="text/css" href="/all.css" media="all"&gt;
</code>

<p>The advantages of doing this over the old fashioned way of creating seperate link references for each of the media types is that you can cut down on requests to your web server. If you have a highly visited website this can make a difference. After you have created your all.css file. The next step is to simply create all the typical things you would for the CSS screen media type. Then below that, place this code. You can replace the .class reference with your own personal CSS. For testing the handheld media type download the Opera web browser since it comes with handheld rendering built into it. </p>

<h4>Targeting Specific Media Types With CSS:</h4>

<code>
@media print {

	.class
	{
	}

}

@media handheld {

	.class
	{
	}

}

@media aural {

	.class
	{
	}

}
</code>

<h4>Notes:</h4>

<p>This works on all modern browsers including IE 6 so feel free to integrate it into your site. </p><p><a href="http://www.nealgrosskopf.com/tech/thread.asp?pid=8">View Comments [2]</a><img src='http://www.nealgrosskopf.com/dev/beacon/image.asp?e=tech' height='1' width='1' /></p>]]>
</description>
<pubDate>Wed, 25 Mar 2008 21:15:25 CST</pubDate>
<guid>http://www.nealgrosskopf.com/tech/thread.asp?pid=8</guid>
<author>Neal Grosskopf</author>
<category>css</category>
</item>
<item>
<title>Checking Plurals With ASP - A Simple Check Plural Function</title>
<link>http://www.nealgrosskopf.com/tech/thread.asp?pid=7</link>
<description>
<![CDATA[
<p>I notice that a lot of database driven websites make easy mistakes by not checking for plural words. An example might be "2 vote" or "1 votes". Here is an example of a function
using ASP to check for plurals.</p>

<code>
function CheckPlural(input)
	if input <> 1 then
		CheckPlural = "s"
	else
		CheckPlural = ""
	end if
end function
</code>

<p>This function can be called like so:</p>

<code>
25 Vote&lt;%=CheckPlural(25)%&gt;
</code><p><a href="http://www.nealgrosskopf.com/tech/thread.asp?pid=7">View Comments [2]</a><img src='http://www.nealgrosskopf.com/dev/beacon/image.asp?e=tech' height='1' width='1' /></p>]]>
</description>
<pubDate>Sat, 21 Mar 2008 14:34:46 CST</pubDate>
<guid>http://www.nealgrosskopf.com/tech/thread.asp?pid=7</guid>
<author>Neal Grosskopf</author>
<category>asp</category><category>function</category>
</item>
<item>
<title>Get File Size And Type Using ASP</title>
<link>http://www.nealgrosskopf.com/tech/thread.asp?pid=6</link>
<description>
<![CDATA[
<p>Often times it is nice to add some text after a link on your website to let your users
know whether the link goes to a PDF and how large that PDF file is. I've found that manually doing this works but after awhile when that PDF file get updated, the file size next to it is incorrect. It is even possible that the link is no longer a PDF but somebody forgot update the text. </p>

<p>An easy solution to these problems is to create a function within ASP that spits out the file type and the file size after the link to let your users know using asp how large a file is and what the file type is. </p>

<h4>How To Get File Size and Type Using ASP</h4>

<code>
function GetFileSizeType(WhatFile)

	set fs=Server.CreateObject("Scripting.FileSystemObject")
	file = Server.MapPath(WhatFile) 
	set f = fs.GetFile(file)
	intSizeK = Int((f.Size/1024) + .5)
	if intSizeK = 0 then intSizeK = 1
	
	GetFileSizeType = "("&amp;UCase(fs.GetExtensionName(file))&amp;", "&amp;intSizeK&amp;"K)"
	
	set f=nothing
	set fs=nothing

end function
</code>

<p>To call this function simply do this:</p>

<code>
GetFileSizeType("/files/pdfs/myfile.pdf")
</code><p><a href="http://www.nealgrosskopf.com/tech/thread.asp?pid=6">View Comments [4]</a><img src='http://www.nealgrosskopf.com/dev/beacon/image.asp?e=tech' height='1' width='1' /></p>]]>
</description>
<pubDate>Mon, 16 Mar 2008 19:02:31 CST</pubDate>
<guid>http://www.nealgrosskopf.com/tech/thread.asp?pid=6</guid>
<author>Neal Grosskopf</author>
<category>asp</category>
</item>
<item>
<title>Change Text Selection Color Using CSS</title>
<link>http://www.nealgrosskopf.com/tech/thread.asp?pid=5</link>
<description>
<![CDATA[
<p>With the advent of CSS3 there are many new ways to style web pages. One of the new features in CSS3 is the ability to change the highlighting color on web pages using CSS. It seems that many websites ignore this simple to implement feature. By default the color will be inherited by your operating system colors. On Windows Vista the hex. color is #3399ff.</p>
<h4>Here's How To Change The Text Selection Color:</h4>
<code>
::selection { background: red; color: white; }
::-moz-selection { background: red; color: white; }
</code>
<h4>Notes:</h4>
<p>This is currently supported by Firefox and Safari. I would suspect that Opera also supports it. Unfortunately Internet Explorer
does not support it, but with IE8 coming out soon supporting CSS better, it may work in there as well.</p>
<h4>Sources</h4>
<ul>
	<li><a href="http://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28CSS%29#Selectors">Comparison of layout engines (CSS)</a></li>
</ul><p><a href="http://www.nealgrosskopf.com/tech/thread.asp?pid=5">View Comments [0]</a><img src='http://www.nealgrosskopf.com/dev/beacon/image.asp?e=tech' height='1' width='1' /></p>]]>
</description>
<pubDate>Mon, 9 Mar 2008 18:32:41 CST</pubDate>
<guid>http://www.nealgrosskopf.com/tech/thread.asp?pid=5</guid>
<author>Neal Grosskopf</author>
<category>css</category><category>css3</category>
</item>
<item>
<title>Advanced Link Styling With CSS - Style External &amp; PDF Links</title>
<link>http://www.nealgrosskopf.com/tech/thread.asp?pid=4</link>
<description>
<![CDATA[
<p>A problem many web designers run into is as their site grows beyond the 50 page mark, it becomes very difficult to introduce new site wide styles. As most of us know it is best to spend as much time planning your site as it is designing and developing it. A step that many designers miss during the planning stage is the styling of specific links. </p>

<h4>The Forgotten Links:</h4>

<ul>
	<li>External links</li>
	<li>PDF links</li>
	<li>Email links (mailto)</li>
    <li>Anchored links</li>
    <li>Popup links (target=&quot;_blank&quot; </li>
    <li>etc. </li>
</ul>

<p>By adding specific styles to these types of links you can add a second layer of usability to your website. When a user sees a PDF icon next to a link they will automatically know that what they are about to click is a PDF. The same can be said for external website links and email links. Many novice CSS designers will solve this problem using classes, i.e &lt;a href=&quot;http://...&quot; class=&quot;external&quot;&gt;My Link&lt;/a&gt;. While this would work early on in site development many of us in the real world inherited a really poorly developed site and need to use other methods to style links site wide. </p>


<h4>Styling External Links With CSS: </h4>

<p>By using CSS3 selectors we can select all &lt;a&gt; tags that <b title="Use the CSS ^ symbol">begin</b> with &quot;http&quot; giving them a background image and padding right to accommodate that image: </p>

<code>
a[href^="http"] {
padding-right: 15px;
background: url(external-image.png) no-repeat center right;
}
</code>


<h4>Styling Email Links With CSS: </h4>

<p>The same can be done with email links. Here we style all &lt;a&gt; tags that <b title="Use the CSS ^ symbol">begin</b> with &quot;mailto:&quot; and apply our email background image. </p>

<code>
a[href^="mailto:"] {
padding-right: 15px;
background: url(email.png) no-repeat center right;
}
</code>


<h4>Styling PDF Links With CSS: </h4>

<p>Finally PDF links can be styled by styling all &lt;a&gt; tags that <b title="Use the CSS $ symbol">end</b> with &quot;.pdf&quot; and apply a pdf icon to them. </p>

<code>
a[href$=".pdf"] {
padding-right: 15px;
background: url(pdf.png) no-repeat center right;
}
</code>


<h4>Putting it all together:</h4>

<code>
a[href^="http"] {
padding-right: 15px;
background: url(external-image.png) no-repeat center right;
}

a[href^="mailto:"] {
padding-right: 15px;
background: url(email.png) no-repeat center right;
}

a[href$=".pdf"] {
padding-right: 15px;
background: url(pdf.png) no-repeat center right;
}
</code>


<h4>Notes:</h4>

<p>This will not work in IE6 but because IE6 does not support the CSS3 selectors. It will show the links as normal without the background image and without the padding. This works out perfectly as users with more modern browsers such as IE7 and Firefox will reap the rewards of your ingenious CSS coding.</p>

<h4>Sources:</h4>

<ul>
	<li><a href="http://en.wikipedia.org/skins-1.5/monobook/main.css">Wikipedia's Style Sheet</a></li>
	<li><a href="http://en.wikipedia.org/wiki/Comparison_of_layout_engines_(CSS)#Selectors">Comparison of layout engines (CSS)</a></li>
</ul><p><a href="http://www.nealgrosskopf.com/tech/thread.asp?pid=4">View Comments [2]</a><img src='http://www.nealgrosskopf.com/dev/beacon/image.asp?e=tech' height='1' width='1' /></p>]]>
</description>
<pubDate>Wed, 4 Mar 2008 18:19:50 CST</pubDate>
<guid>http://www.nealgrosskopf.com/tech/thread.asp?pid=4</guid>
<author>Neal Grosskopf</author>
<category>css</category>
</item>
<item>
<title>CSS Diagnostics - Find Deprecated Elements Using CSS</title>
<link>http://www.nealgrosskopf.com/tech/thread.asp?pid=3</link>
<description>
<![CDATA[
<h4 class="highlight">UPDATED: April 25th</h4>

<p>I've been getting so many hits on this article that I decided to update it. I have added a few more elements and attributes and changed the colors around. 
The most severe code is colored red while less severe is colored yellow.  There is also a medium severarity that is colored orange. Also remember that elements have solid borders while
attributes have dotted boreders. Also check out my <a href="/tech/resources/3/test_suite.html">Test Suite showing examples of CSS Diagnostics in action</a>.</p>

<p>The other day I was reading <a href="http://meyerweb.com">Eric Meyer's blog</a> and stumbled across his version of what he likes to call
CSS diagnostics. So what is CSS diagnostics?
It's a method to highlight those ugly spots in your code, you know &lt;font color="red" size="+1"&gt;. Yeah
under the hood, somewhere on your website garbage like that exists, yet it's always so hard to hunt down and fix.
Never fear CSS diagnostics is here!</p>

<p>CSS Diagnostics allows users to find deprecated elements using CSS and also find find deprecated attributes using CSS. 
<span class="i">Sorry to have to repeat myself so much here, I'm trying to rank high in SEO with some of these terms 
since this is still very much uncharted territory.</span></p>

<p>So how do you use CSS Diagnostics? It's easy! It requires a pretty good knowledge of CSS 2 & CSS 3 selectors and a
good knowledge of deprecated HTML elements and attributes.</p>

<h4>Follow these steps:</h4>

<ol>

<li>
<h4>Highlight Deprecated Elements</h4>
<code>
applet, basefont, center, dir, font, isindex, menu, s, strike, u, marquee, blink, acronym /* html 5, use abbr */
{ border: 5px solid red !important; }
</code>
</li>

<li>
<h4>Highlight Deprecated Attributes</h4>
<code>
br[clear], hr[noshade], *[color],
*[bordercolorlight], *[bordercolordark], *[bordercolor], *[background], *[bgcolor], *[nowrap],
body[alink], body[link], body[text], body[vlink],
body[bottommargin], body[leftmargin], body[rightmargin], body[topmargin], body[marginheight], body[marginwidth], 
ol[compact], ul[compact], *[start],
img[hspace], img[vspace]
*[align], *[valign],
*[height], *[width],
ul[type], ol[type], li[type],
basefont[size], font[size], hr[size]
{ border: 5px dotted red !important; }
</code>
</li>

<li>
<h4>Highlight Proposed Deprecated Elements</h4>
<code>
input[type="button"], input[type="reset"], input[type="submit"],
tt, embed,
big, small
{ border: 5px solid orange !important; }
</code>
</li>

<li>
<h4>Highlight Proposed Deprecated Attributes</h4>
<code>
a[target], table[cellpadding], table[cellspacing],
map[name], img[name], object[name], form[name], iframe[name], a[name],
table[border], img[border], object[border], input[border],
object[classid], object[codebase], embed[quality], embed[pluginspage]
{ border: 5px dotted orange !important; }
</code>
</li>

<li>
<h4>Highlight Specific Empty Elements:</h4>
<code>
div:empty, span:empty, li:empty, p:empty, td:empty, th:empty 
{ padding: 20px; border: 5px solid yellow !important; }
</code>
</li>

<li>
<h4>Highlight Specific Empty Attributes</h4>
<code>
*[alt=""], *[title=""], *[class=""], *[id=""], a[href=""], a[href="#"] 
{ border: 5px dotted yellow !important; }
</code>
</li>

</ol>


<h4>Putting it all together:</h4>

<p>Place this code at the end of your stylesheet:</p>

<code>
/* Deprecated Elements */
applet, basefont, center, dir, font, isindex, menu, s, strike, u, marquee, blink, acronym /* html 5, use abbr */
{ border: 5px solid red !important; }

/* Deprecated Attributes */
br[clear], hr[noshade], *[color],
*[bordercolorlight], *[bordercolordark], *[bordercolor], *[background], *[bgcolor], *[nowrap],
body[alink], body[link], body[text], body[vlink],
body[bottommargin], body[leftmargin], body[rightmargin], body[topmargin], body[marginheight], body[marginwidth], 
ol[compact], ul[compact], *[start],
img[hspace], img[vspace]
*[align], *[valign],
*[height], *[width],
ul[type], ol[type], li[type],
basefont[size], font[size], hr[size]
{ border: 5px dotted red !important; }

/* Proposed Deprecated Elements */
input[type="button"], input[type="reset"], input[type="submit"],
tt, embed,
big, small
{ border: 5px solid orange !important; }

/* Proposed Deprecated Attributes */
a[target], table[cellpadding], table[cellspacing],
map[name], img[name], object[name], form[name], iframe[name], a[name],
table[border], img[border], object[border], input[border],
object[classid], object[codebase], embed[quality], embed[pluginspage]
{ border: 5px dotted orange !important; }

/* Empty Elements */
div:empty, span:empty, li:empty, p:empty, td:empty, th:empty 
{ padding: 20px; border: 5px solid yellow !important; }

/* Empty Attributes */
*[alt=""], *[title=""], *[class=""], *[id=""], a[href=""], a[href="#"] 
{ border: 5px dotted yellow !important; }
</code>

<p class="b"><a href="/tech/resources/3/css-diagnostics.css">Download The Full Stylesheet</a></p>

<h4>Notes:</h4>

<p>It's a good idea to create consistency with your rules. I chose to highlight all attributes in a solid border while
highlighting all elements in a dotted border. Also choose different colors for different meanings.</p>

<p>It should also be pointed out that you should use the most standards complient web browser when checking for results. Currently
I found that Firefox 2 seems to work best as it comes with many other addons that can work side by side with the custom CSS.</p>

<p>I enjoyed reading Eric's ideas on it but felt I could expand it a bit more. Certainly other's can expand on my version as well.
Feel free to <a href="/forms/contact.asp">contact me</a> if you see something I'm missing.</p>

<h4>Sources</h4>

<ul>
	<li><a href="http://meyerweb.com/eric/tools/css/diagnostics/">http://meyerweb.com/eric/tools/css/diagnostics/</a></li>
	<li><a href="http://www.w3.org/TR/html401/index/elements.html">http://www.w3.org/TR/html401/index/elements.html</a></li>
	<li><a href="http://www.w3.org/TR/2005/WD-xhtml2-20050527/elements.html">http://www.w3.org/TR/2005/WD-xhtml2-20050527/elements.html</a></li>
	<li><a href="http://www.w3.org/TR/2005/WD-xhtml2-20050527/attributes.html">http://www.w3.org/TR/2005/WD-xhtml2-20050527/attributes.html</a></li>
	<li><a href="http://www.w3.org/TR/2008/WD-html5-diff-20080122/">http://www.w3.org/TR/2008/WD-html5-diff-20080122/</a></li>
	<li><a href="http://www.html-reference.com/depreciated.htm">http://www.html-reference.com/depreciated.htm</a></li>
	<li><a href="http://www.codehelp.co.uk/html/deprecated.html">http://www.codehelp.co.uk/html/deprecated.html</a></li>
</ul><p><a href="http://www.nealgrosskopf.com/tech/thread.asp?pid=3">View Comments [5]</a><img src='http://www.nealgrosskopf.com/dev/beacon/image.asp?e=tech' height='1' width='1' /></p>]]>
</description>
<pubDate>Wed, 18 Feb 2008 21:51:35 CST</pubDate>
<guid>http://www.nealgrosskopf.com/tech/thread.asp?pid=3</guid>
<author>Neal Grosskopf</author>
<category>html</category><category>validation</category><category>css</category><category>css diagnostics</category>
</item>
<item>
<title>How To Use target="_blank" Correctly In XHTML &amp; HTML Strict</title>
<link>http://www.nealgrosskopf.com/tech/thread.asp?pid=2</link>
<description>
<![CDATA[
<p>Occasionally web developers like their links to pop-up in a new window. Often times this is because they are
linking to a non-web file type or are linking to an external web site.</p>

<p>The easiest way to accomplish this is to place the target="_blank" attribute on an anchor. Unfortunately if you validate
your code with the W3C you will find that it is not valid to use that practice. Do not fear, there is a solution!</p>

<p>The workaround err, solution, is to place an onclick on the anchor tag. The code below will open a new window, get the value in 
the href attribute and cancel the action the href attribute would take.</p>

<code>
&lt;a href="http://www.nealgrosskopf.com" onclick="window.open(this.href);return false;"&gt;Link&lt;/a&gt;
</code><p><a href="http://www.nealgrosskopf.com/tech/thread.asp?pid=2">View Comments [3]</a><img src='http://www.nealgrosskopf.com/dev/beacon/image.asp?e=tech' height='1' width='1' /></p>]]>
</description>
<pubDate>Sat, 28 Jan 2008 19:56:1 CST</pubDate>
<guid>http://www.nealgrosskopf.com/tech/thread.asp?pid=2</guid>
<author>Neal Grosskopf</author>
<category>validation</category><category>javascript</category><category>html</category>
</item>
<item>
<title>How To Serve XHTML to Internet Explorer 6 And 7 as XML Using Content Negotiation</title>
<link>http://www.nealgrosskopf.com/tech/thread.asp?pid=1</link>
<description>
<![CDATA[
<p>It seems that XHTML is all the craze now days. Unfortunately very few developers and designers are using it correctly
and taking full advantage of it. So why is this?</p>

<p>XHTML can be served as text or XML. It seems that 90% of sites using XHTML are serving it as XML but are failing to serve it
correctly to Internet Explorer as XML. Never fear, there is a solution.</p>

<p>So why bother serving it as XML to Internet Explorer? If you do it will mean that your html code will appear as XML and will have
to adhere to XML standards. This means that you can be sure the code you are using is extremely compliant. It will also mean
that if your page is not valid, <a href="http://en.wikipedia.org/wiki/Screens_of_death#Mozilla">it will not display without error</a>. 
It's an annoying but great way to keep your code clean</p>

<h4>Follow these steps:</h4>

<ol>

<li>
  <h4>Serve your page as application/xml to Internet Explorer and as application/xhtml+xml to every other browser:</h4>
  <code>
If InStr(Request.ServerVariables("HTTP_ACCEPT"), "application/xhtml+xml") > 0 Then
	Response.ContentType = "application/xhtml+xml"
Else
	Response.ContentType = "application/xml"
End If
</code>
</li>

<li><h4>Use a special .xsl file at the top of your page above your doctype:</h4>
<code>
&lt;?xml-stylesheet type="text/xsl" href="xhtml.xsl"?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
</code>

<h4>Contents of xhtml.xsl file:</h4>
<code>
&lt;stylesheet version="1.0"
     xmlns="http://www.w3.org/1999/XSL/Transform"&gt;
    &lt;template match="/"&gt;
        &lt;copy-of select="."/&gt;
    &lt;/template&gt;
&lt;/stylesheet&gt;
</code>
</li>

<li><h4>Add html element to page:</h4>
<code>
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"&gt;
</code>
</li>

</ol>

<h4>Putting it all together:</h4>

<code>
&lt;%
If InStr(Request.ServerVariables("HTTP_ACCEPT"), "application/xhtml+xml") &gt; 0 Then
    Response.ContentType = "application/xhtml+xml"
Else
    Response.ContentType = "application/xml"
End If
Response.Charset = "utf-8"
%&gt;
&lt;?xml-stylesheet type="text/xsl" href="xhtml.xsl"?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"&gt;
&lt;head&gt;
&lt;title&gt;XHTML&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;/body&gt;
&lt;/html&gt;
</code>

<h4>Sources</h4>

<ul>
	<li><a href="http://www.perlmonks.org/?node_id=639170">OT: How do you serve up XHTML?</a></li>
	<li><a href="http://www.w3.org/TR/2007/WD-xhtml11-20070216/conformance.html#docconf">XHTML 1.1 Conformance Definition</a></li>
	<li><a href="http://juicystudio.com/article/content-negotiation.php#asp">MIME Types and Content Negotiation</a></li>
	<li><a href="http://blogs.msdn.com/ie/archive/2005/09/15/467901.aspx">The &lt;?xml&gt; prolog, strict mode, and XHTML in IE</a></li>
	<li><a href="http://www.w3.org/People/mimasa/test/xhtml/media-types/MSIE7.0Beta2">XHTML media type test - results: Microsoft Internet Explorer 7.0 Beta2</a></li>
	<li><a href="http://www.w3.org/People/mimasa/test/xhtml/media-types/results">XHTML media type test - results</a></li>
	<li><a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2058872&amp;SiteID=1">Cannot have a DOCTYPE declaration outside of a prolog. Error processing resource</a></li>
	<li><a href="http://www.w3.org/MarkUp/2004/xhtml-faq#ie">Does Microsoft Internet Explorer accept the media type application/xhtml+xml?</a></li>
	<li><a href="http://ptaff.ca/xhtml/?lang=en_CA">XHTML: How to succeed</a></li>
	<li><a href="http://www.evotech.net/blog/2007/07/xhtml-deprecated-elements-and-attributes/">XHTML Deprecated Elements and Attributes</a></li>
</ul><p><a href="http://www.nealgrosskopf.com/tech/thread.asp?pid=1">View Comments [3]</a><img src='http://www.nealgrosskopf.com/dev/beacon/image.asp?e=tech' height='1' width='1' /></p>]]>
</description>
<pubDate>Tue, 24 Jan 2008 21:02:24 CST</pubDate>
<guid>http://www.nealgrosskopf.com/tech/thread.asp?pid=1</guid>
<author>Neal Grosskopf</author>
<category>internet explorer</category><category>xhtml</category><category>xml</category><category>xsl</category>
</item>
</channel>
</rss>
