<?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>Borgar.net &#187; html</title>
	<atom:link href="http://borgar.net/tagged/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://borgar.net</link>
	<description>All the wisdom of the rainbow.</description>
	<lastBuildDate>Tue, 23 Mar 2010 23:12:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0-RC1-15022</generator>
		<item>
		<title>Node members or Node attributes</title>
		<link>http://borgar.net/s/2008/05/node-members-or-node-attributes/</link>
		<comments>http://borgar.net/s/2008/05/node-members-or-node-attributes/#comments</comments>
		<pubDate>Thu, 29 May 2008 23:22:17 +0000</pubDate>
		<dc:creator>Borgar</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[dom]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://borgar.undraland.com/?p=1013</guid>
		<description><![CDATA[Having given it a bit of thought I think that this problem stems from a slight confusion as to how DOM nodes&#8217; attributes work. You would expect javascript code to execute when you apply it to an attribute: someNode.onclick = "alert('foo');"; And you expect this to work because this is exactly what you do in [...]]]></description>
			<content:encoded><![CDATA[<p>Having given it a bit of thought I think that <a href="http://meyerweb.com/eric/thoughts/2008/05/29/need-help-with-table-row-events/">this problem</a> stems from a slight confusion as to how <acronym title="Document Object Model">DOM</acronym> nodes&#8217; attributes work.</p>
<p>You would expect javascript code to execute when you apply it to an attribute:</p>
<pre><code>someNode.onclick = "alert('foo');";</code></pre>
<p>And you expect this to work because <em>this is exactly what you do in your <acronym title="HyperText Markup Language">HTML</acronym></em>. And in some browsers it does. <strong>Some</strong> browsers.</p>
<p>I don&#8217;t know another way to say it, maybe there is someone who can fix my terminology but here&#8217;s the thing: Element attributes are different from node members.</p>
<p>I remember all to well the grief this caused me when I started working with DOMnodes in Javascript. Sooner or later, you will run into these inconsistencies. The browsers also try their best at blurring the difference between attributes and members. Which is helpful when you know how it works.</p>
<p>Consider this <acronym title="Cascading Style Sheets">CSS</acronym>:</p>
<pre><code>input[type="text"][value=""] { background: teal; }</code></pre>
<p>It colors an empty input field. But why doesn&#8217;t the field update when you type text in the box? <code>theInput.value</code> gives you whatever you typed in there.</p>
<p>This is because <code>.value</code> is a node member that contains what is displayed in the box, while the actual attribute contents are exposed on <code>.defaultValue</code>, which incidentally is what <code>[value]</code> is examining (and what is copied to <code>.value</code> should the inputs form be reset).</p>
<p>With onclick, the node has a <code>.onclick</code> member that is a <em>reference to</em> a function (or <code>null</code>). When the <acronym title="HyperText Markup Language">HTML</acronym> is parsed into a <acronym title="Document Object Model">DOM</acronym> tree, any code in onclick attributes is turned into an anonymous function and a reference to it is placed on the onclick member of the node.</p>
<p>So why does the following code fail in <acronym title="Microsoft Internet Explorer">MSIE</acronym>?</p>
<pre><code>someNode.onclick = "alert('foo');";</code></pre>
<p>Because <acronym title="Microsoft Internet Explorer">MSIE</acronym> doesn&#8217;t evaluate the string as it is placed on the member. The onclick becomes a reference to a string and if the event occurs <acronym title="Microsoft Internet Explorer">MSIE</acronym> will complain because effectively we&#8217;ve just tried to do this:</p>
<pre><code>"alert('foo');"();</code></pre>
<p>Does this make any more sense, or did things suddenly get more complicated?</p>]]></content:encoded>
			<wfw:commentRss>http://borgar.net/s/2008/05/node-members-or-node-attributes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lesefni handa upprennandi vefurum</title>
		<link>http://borgar.net/s/2007/02/css-reading/</link>
		<comments>http://borgar.net/s/2007/02/css-reading/#comments</comments>
		<pubDate>Mon, 12 Feb 2007 10:59:02 +0000</pubDate>
		<dc:creator>Borgar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://borgar.undraland.com/s/2007/02/12/10.59.02/</guid>
		<description><![CDATA[Læra eins og margföldunartöfluna og þjóðsönginn: HTTP://www.w3.org/Protocols/ HTTP://www.w3.org/MarkUp/#recommendations HTTP://www.w3.org/Style/CSS/#specs Möst lesning: HTTP://www.thinkvitamin.com/features/design/stand-up-for-your-rights HTTP://webtypography.net/ HTTP://www.alistapart.com/ HTTP://diveintoaccessibility.org/ HTTP://joeclark.org/book/sashay/serialization/ HTTP://javascript.crockford.com/ HTTP://mar.anomy.net/entry/2006/10/04/09.44.54/ Fylgjast með: HTTP://blogs.msdn.com/ie/default.aspx HTTP://yuiblog.com/blog HTTP://bitesizestandards.com/ HTTP://www.webstandards.org/ HTTP://web-graphics.com/ HTTP://www.quirksmode.org/bugreports/ HTTP://webkit.org/blog/ Gúrú: HTTP://ln.hixie.ch/ HTTP://simonwillison.net/ HTTP://meyerweb.com/ HTTP://dean.edwards.name/weblog/ HTTP://mezzoblue.com/ HTTP://www.zeldman.com/ HTTP://molly.com/ HTTP://www.quirksmode.org/blog/ HTTP://www.shauninman.com/ HTTP://www.andybudd.com/ HTTP://snook.ca/jonathan/ HTTP://www.stopdesign.com/ HTTP://annevankesteren.nl/ HTTP://mar.anomy.net/ HTTP://blog.fawny.org/ HTTP://diveintomark.org/ HTTP://www.crockford.com/ CSS display: HTTP://cssvault.com/ HTTP://www.stylegala.com/ HTTP://www.cssbeauty.com/ Tæki og tól: HTTP://dean.edwards.name/packer/ HTTP://jslint.com/ [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Læra eins og margföldunartöfluna og þjóðsönginn:</strong></p>
<ul>
<li><a href="http://www.w3.org/Protocols/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://www.w3.org/Protocols/</a>
<li><a href="http://www.w3.org/MarkUp/#recommendations"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://www.w3.org/MarkUp/#recommendations</a>
<li><a href="http://www.w3.org/Style/CSS/#specs"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://www.w3.org/Style/CSS/#specs</a>
</ul>
<p><strong>Möst lesning:</strong></p>
<ul>
<li><a href="http://www.thinkvitamin.com/features/design/stand-up-for-your-rights"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://www.thinkvitamin.com/features/design/stand-up-for-your-rights</a>
<li><a href="http://webtypography.net/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://webtypography.net/</a>
<li><a href="http://www.alistapart.com/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://www.alistapart.com/</a>
<li><a href="http://diveintoaccessibility.org/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://diveintoaccessibility.org/</a>
<li><a href="http://joeclark.org/book/sashay/serialization/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://joeclark.org/book/sashay/serialization/</a>
<li><a href="http://javascript.crockford.com/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://javascript.crockford.com/</a>
<li><a href="http://mar.anomy.net/entry/2006/10/04/09.44.54/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://mar.anomy.net/entry/2006/10/04/09.44.54/</a>
</ul>
<p><strong>Fylgjast með:</strong></p>
<ul>
<li><a href="http://blogs.msdn.com/ie/default.aspx"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://blogs.msdn.com/ie/default.aspx</a>
<li><a href="http://yuiblog.com/blog"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://yuiblog.com/blog</a>
<li><a href="http://bitesizestandards.com/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://bitesizestandards.com/</a>
<li><a href="http://www.webstandards.org/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://www.webstandards.org/</a>
<li><a href="http://web-graphics.com/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://web-graphics.com/</a>
<li><a href="http://www.quirksmode.org/bugreports/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://www.quirksmode.org/bugreports/</a>
<li><a href="http://webkit.org/blog/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://webkit.org/blog/</a>
</ul>
<p><strong>Gúrú:</strong></p>
<ul>
<li><a href="http://ln.hixie.ch/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://ln.hixie.ch/</a>
<li><a href="http://simonwillison.net/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://simonwillison.net/</a>
<li><a href="http://meyerweb.com/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://meyerweb.com/</a>
<li><a href="http://dean.edwards.name/weblog/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://dean.edwards.name/weblog/</a>
<li><a href="http://mezzoblue.com/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://mezzoblue.com/</a>
<li><a href="http://www.zeldman.com/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://www.zeldman.com/</a>
<li><a href="http://molly.com/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://molly.com/</a>
<li><a href="http://www.quirksmode.org/blog/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://www.quirksmode.org/blog/</a>
<li><a href="http://www.shauninman.com/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://www.shauninman.com/</a>
<li><a href="http://www.andybudd.com/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://www.andybudd.com/</a>
<li><a href="http://snook.ca/jonathan/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://snook.ca/jonathan/</a>
<li><a href="http://www.stopdesign.com/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://www.stopdesign.com/</a>
<li><a href="http://annevankesteren.nl/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://annevankesteren.nl/</a>
<li><a href="http://mar.anomy.net/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://mar.anomy.net/</a>
<li><a href="http://blog.fawny.org/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://blog.fawny.org/</a>
<li><a href="http://diveintomark.org/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://diveintomark.org/</a>
<li><a href="http://www.crockford.com/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://www.crockford.com/</a>
</ul>
<p><strong><acronym title="Cascading Style Sheets">CSS</acronym> display:</strong></p>
<ul>
<li><a href="http://cssvault.com/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://cssvault.com/</a>
<li><a href="http://www.stylegala.com/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://www.stylegala.com/</a>
<li><a href="http://www.cssbeauty.com/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://www.cssbeauty.com/</a>
</ul>
<p><strong>Tæki og tól:</strong></p>
<ul>
<li><a href="http://dean.edwards.name/packer/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://dean.edwards.name/packer/</a>
<li><a href="http://jslint.com/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://jslint.com/</a>
<li><a href="http://infohound.net/tidy/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://infohound.net/tidy/</a>
<li><a href="http://getfirebug.com/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://getfirebug.com/</a>
<li><a href="http://riddle.pl/emcalc/"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://riddle.pl/emcalc/</a>
<li><a href="http://dojotoolkit.org/~david/recss.html"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://dojotoolkit.org/~david/recss.html</a>
</ul>
<p><strong>Gott reference:</strong></p>
<ul>
<li><a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference</a>
<li><a href="http://developer.mozilla.org/en/docs/Gecko_DOM_Reference"><acronym title="HyperText Transfer Protocol">HTTP</acronym>://developer.mozilla.org/en/docs/Gecko_DOM_Reference</a>
</ul>]]></content:encoded>
			<wfw:commentRss>http://borgar.net/s/2007/02/css-reading/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Replacing HR elements with images</title>
		<link>http://borgar.net/s/2007/01/style-hr-elements/</link>
		<comments>http://borgar.net/s/2007/01/style-hr-elements/#comments</comments>
		<pubDate>Tue, 09 Jan 2007 14:52:22 +0000</pubDate>
		<dc:creator>Borgar</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[msie]]></category>

		<guid isPermaLink="false">http://borgar.undraland.com/s/2007/01/09/14.52.22/</guid>
		<description><![CDATA[Yesterday I was presented with the problem of using an image for the HR tag. Quick googling confirmed my suspicion, that this is something a lot of people want to achieve but apparently it can&#8217;t be done because of, as usual, IE&#8217;s limitations. The recommendations seem to be to either wrap the HR in a [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I was presented with the problem of using an image for the <code>HR</code> tag. Quick googling confirmed my suspicion, that this is something a lot of people want to achieve but apparently <a href="http://www.sovavsiti.cz/css/hr.html" title="Styling HR with CSS">it can&#8217;t be done</a> because of, as usual, IE&#8217;s limitations.</p>
<p>The recommendations seem to be to either <a href="http://bitesizestandards.com/bites/styling-horizontal-rules-with-css" title="Styling horizontal rules with CSS">wrap the <code>HR</code> in a div</a> and styling that, or just simply work around it by not using images. But of course it can be done, and here&#8217;s how:</p>
<p>We start with some nice clean code for all the <q>&#8220;alternative&#8221;</q> browsers:</p>
<pre><code>hr {
  border : 0;
  height : 15px;
  background : url(hr.gif) 0 0 no-repeat;
  margin : 1em 0;
}</code></pre>
<p>This seems to work for all standards compliant modern browsers. I&#8217;ve tested it on Opera, Safari &#038; Firefox. However, it does not work on Explorer. <acronym title="Internet Explorer">IE</acronym> treats the element as inline and demands a border around it and a minimum height of 1px.</p>
<p><acronym title="Internet Explorer">IE</acronym> supports very basic generated content with the <code>list-style-image</code> setting when combined with <code>display: list-item</code>. This is what I&#8217;ve used to get around the limitations.</p>
<p>Add this into conditional comments (or hacks if you prefer) to shift the element out of the way and insert a bullet picture in the resulting space:</p>
<pre><code>hr {
  display : list-item;
  list-style : url(hr.gif) inside;
  filter : alpha(opacity=0);
  width : 0;
}</code></pre>
<p><del>My implementation here has the limitation of demanding that the image you use is equal to the width of the text area, but this should be easy to get around or customize.</del></p>
<p><del>The border setting can be replaced with a <code>color: #fff;</code>. To kill the default border you must set either one to the background color. Possibly it might be shifted out of hidden overflow but I have not tried it.</del></p>
<p>You can view a live example <a href="http://borgar.undraland.com/files/hr-example/" title="A live example of ">here</a>.</p>
<h3>Updated &#8211; 16. 1. 2007:</h3>
<p>I&#8217;ve updated this entry and the example with the <a href="http://mar.anomy.net/entry/2007/01/14/00.37.48/">improvements suggested by Már</a>. There are no longer any limitations on this technique.</p>]]></content:encoded>
			<wfw:commentRss>http://borgar.net/s/2007/01/style-hr-elements/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Hamskipti</title>
		<link>http://borgar.net/s/2003/07/hamskipti/</link>
		<comments>http://borgar.net/s/2003/07/hamskipti/#comments</comments>
		<pubDate>Wed, 02 Jul 2003 23:04:13 +0000</pubDate>
		<dc:creator>Borgar</dc:creator>
				<category><![CDATA[html]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://borgar.net/blog/?p=211</guid>
		<description><![CDATA[Nýi vefurinn minn er loksins kominn í loftið. Hann er svo 1000x þægilegri að skrifa á en sá gamli vegna þess að ég er búinn að forrita mitt eigið wiki kerfi. Það þýðir (á mannamáli) að ég þarf ekki lengur að skrifa HTML þegar ég vil framkvæma hluti eins og línubil. Ahhh&#8230; Vefurinn er ekki [...]]]></description>
			<content:encoded><![CDATA[<p>Nýi vefurinn minn er loksins kominn í loftið. Hann er svo 1000x þægilegri að skrifa á en sá gamli vegna þess að ég er búinn að forrita mitt eigið wiki kerfi. Það þýðir (á mannamáli) að ég þarf ekki lengur að skrifa <acronym title="HyperText Markup Language">HTML</acronym> þegar ég vil framkvæma hluti eins og línubil. Ahhh&#8230;</p>
<p>Vefurinn er ekki fullkomlega tilbúinn ennþá en ég var farinn að fá svo mikið að kvörtunum að ég gat ekki lengur beðið með þetta. Ég mun svo í rólegheitum setja inn commentakerfi, betra stílblað, osfrv&#8230;</p>]]></content:encoded>
			<wfw:commentRss>http://borgar.net/s/2003/07/hamskipti/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
