<?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>Sun Limited Mt. &#187; HTML</title>
	<atom:link href="http://blog.syuhari.jp/archives/category/html/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.syuhari.jp</link>
	<description>I love iPhone, CakePHP and WordPress.</description>
	<lastBuildDate>Thu, 20 Oct 2011 19:36:15 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>HTML の正しいコメント</title>
		<link>http://blog.syuhari.jp/archives/1485</link>
		<comments>http://blog.syuhari.jp/archives/1485#comments</comments>
		<pubDate>Sat, 18 Jul 2009 01:31:57 +0000</pubDate>
		<dc:creator>matsuura</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[comment]]></category>

		<guid isPermaLink="false">http://www.syuhari.jp/blog/?p=1485</guid>
		<description><![CDATA[HTML のコメントは &#60;!-- comment --&#62; のように、&#60;!-- で始まり、--&#62; で終わるのですが「コメントに連続したハイフンは含んではいけない」というルールがあります。HTML2.0 では許されていましたが、HTML4.0 では許されていません。 &#60;!-- comment--------&#62; と書いても正しくはコメントとはなりません。IE だと IE6 or IE7 でもコメントと認識するようですが、Firefox ではコメント扱いしてくれません。HTML エディタとして使っている Coda でも同様でした。（まあ、当然なのですが）上のようなコメントは閉じていないコメントとなり、それ以降が表示されなくなります。 もっと困るのは下のような場合、 &#60;!-- comment------&#62; hoge &#60;!-- comment end ------&#62; IE だと hoge は表示されるが、Firefox だと最初のコメントから2つ目のコメントの終わりの --&#62; をコメントの終わりと解釈して hoge は表示されない。 また、XHTML ではコメントは以下のように定義されています。 Comment ::= '&#60;!--' ((Char - '-') &#124; ('-' (Char - '-')))* '--&#62;' ということで正しいコメントを使いましょう。 3.2.4 [...]]]></description>
			<content:encoded><![CDATA[<p>HTML のコメントは</p>
<p><code>&lt;!-- comment --&gt;</code></p>
<p>のように、<code>&lt;!--</code> で始まり、<code>--&gt;</code> で終わるのですが「コメントに連続したハイフンは含んではいけない」というルールがあります。HTML2.0 では許されていましたが、HTML4.0 では許されていません。<br />
<span id="more-1485"></span><br />
<code>&lt;!-- comment--------&gt;</code><br />
と書いても正しくはコメントとはなりません。IE だと IE6 or IE7 でもコメントと認識するようですが、Firefox ではコメント扱いしてくれません。HTML エディタとして使っている Coda でも同様でした。（まあ、当然なのですが）上のようなコメントは閉じていないコメントとなり、それ以降が表示されなくなります。</p>
<p>もっと困るのは下のような場合、<br />
<code>&lt;!-- comment------&gt;<br />
hoge<br />
&lt;!-- comment end ------&gt;</code></p>
<p>IE だと hoge は表示されるが、Firefox だと最初のコメントから2つ目のコメントの終わりの <code>--&gt;</code> をコメントの終わりと解釈して hoge は表示されない。</p>
<p>また、XHTML ではコメントは以下のように定義されています。<br />
<code>Comment ::= '&lt;!--' ((Char - '-') | ('-' (Char - '-')))* '--&gt;'</code></p>
<p>ということで正しいコメントを使いましょう。</p>
<blockquote><p>3.2.4 Comments<br/><br />
HTML comments have the following syntax:<br/><br />
<code>&lt;!-- this is a comment --&gt;<br />
&lt;!-- and so is this one,<br />
    which occupies more than one line --&gt;</code><br/><br />
White space is not permitted between the markup declaration open delimiter(&#8220;&lt;!&#8221;) and the comment open delimiter (&#8220;<code>--</code>&#8220;), but is permitted between the comment close delimiter (&#8220;<code>--</code>&#8220;) and the markup declaration close delimiter (&#8220;&lt;&#8221;). A common error is to include a string of hyphens (&#8220;<code>---</code>&#8220;) within a comment. Authors should avoid putting two or more adjacent hyphens inside comments.<br/><br />
Information that appears between comments has no special meaning (e.g., character references are not interpreted as such).<br/><br />
Note that comments are markup.</p></blockquote>
<p><a href="http://www.w3.org/TR/html4/intro/sgmltut.html" target="_blank" class="liexternal">On SGML and HTML</a></p>
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.syuhari.jp%2Farchives%2F1485&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>]]></content:encoded>
			<wfw:commentRss>http://blog.syuhari.jp/archives/1485/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>optionタグを選択不可にする disabled 属性を IE6 でも有効にする方法</title>
		<link>http://blog.syuhari.jp/archives/61</link>
		<comments>http://blog.syuhari.jp/archives/61#comments</comments>
		<pubDate>Thu, 09 Aug 2007 20:43:25 +0000</pubDate>
		<dc:creator>matsuura</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[behavior]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[disable]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[ec]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[option]]></category>
		<category><![CDATA[select]]></category>
		<category><![CDATA[URL]]></category>

		<guid isPermaLink="false">http://www.syuhari.jp/blog/archives/61</guid>
		<description><![CDATA[optionタグを選択不可にする disabled 属性で紹介したように option タグに disabled 属性を指定することにより選択不可にすることができるのですが、IE6 では選択できてしまいます。 JavaScript で解決する方法です。 Select, Option, Disabled And The JavaScript Solution 上記の参考サイトに詳しくやり方が書かれていますので、簡単に手順だけ紹介。 参考サイトの「Implementing」にある download リンクより JavaScript コード(select-option-disabled-emulation.js)をダウンロード select-option-disabled-emulation.js を適当な場所に保存 html 内で select-option-disabled-emulation.js を読み込む 選択不可にしたい option タグに disabled 属性を指定する DHTML で解決する方法です。 これは上記参考サイトの補足で紹介されていたサイトです。 apptaro&#8217;s blog: Emulating Disabled Options in IE with DHTML Behaviors こちらも上記URL に詳しいやり方が書かかれていますので、簡単にご紹介。 参考サイトの中央よりやや下にある Download よりファイル一式をダウンロード 適当な場所に css, htc [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.syuhari.jp/blog/archives/59" class="liinternal">optionタグを選択不可にする disabled 属性</a>で紹介したように option タグに disabled 属性を指定することにより選択不可にすることができるのですが、IE6 では選択できてしまいます。</p>
<h4>JavaScript で解決する方法です。</h4>
<p><a href="http://www.lattimore.id.au/2005/07/01/select-option-disabled-and-the-javascript-solution/">Select, Option, Disabled And The JavaScript Solution </a></p>
<p>上記の参考サイトに詳しくやり方が書かれていますので、簡単に手順だけ紹介。</p>
<ul>
<li>参考サイトの「Implementing」にある download リンクより JavaScript コード(select-option-disabled-emulation.js)をダウンロード</li>
<li>select-option-disabled-emulation.js を適当な場所に保存</li>
<li>html 内で select-option-disabled-emulation.js を読み込む</li>
<li>選択不可にしたい option タグに disabled 属性を指定する</li>
</ul>
<h4>DHTML で解決する方法です。</h4>
<p>これは上記参考サイトの補足で紹介されていたサイトです。<br />
<a href="http://apptaro.seesaa.net/article/21140090.html" target="_blank" class="liexternal">apptaro&#8217;s blog: Emulating Disabled Options in IE with DHTML Behaviors</a></p>
<p>こちらも上記URL に詳しいやり方が書かかれていますので、簡単にご紹介。</p>
<ul>
<li>参考サイトの中央よりやや下にある Download よりファイル一式をダウンロード</li>
<li>適当な場所に css, htc ファイルを保存</li>
<li>html で上記 css を読み込む</li>
<li>選択不可にしたい option タグに disabled 属性を指定する</li>
</ul>
<p>これで IE6 でも option タグの disabled 属性が使えるようになりました。</p>
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.syuhari.jp%2Farchives%2F61&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>]]></content:encoded>
			<wfw:commentRss>http://blog.syuhari.jp/archives/61/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>optionタグを選択不可にする disabled 属性</title>
		<link>http://blog.syuhari.jp/archives/59</link>
		<comments>http://blog.syuhari.jp/archives/59#comments</comments>
		<pubDate>Thu, 09 Aug 2007 20:13:56 +0000</pubDate>
		<dc:creator>matsuura</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[action]]></category>
		<category><![CDATA[age]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[disable]]></category>
		<category><![CDATA[ec]]></category>
		<category><![CDATA[element]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[option]]></category>
		<category><![CDATA[select]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://www.syuhari.jp/blog/archives/59</guid>
		<description><![CDATA[フォーム画面を動的に表示してある条件のときにはラジオボタンなどを disabled にしたりします。 今回もあるフォームを作成していて在庫が0のときに select タグで表示する項目を選択できないようにしたかったので調べてみたところ、option タグにも disabled 属性がありました。 そこで下記のようにしてみたところ &#60;form action=""&#62; &#60;select&#62; &#60;option&#62;オプション1&#60;/option&#62; &#60;option disabled="disabled"&#62;オプション2&#60;/option&#62; &#60;option&#62;オプション3&#60;/option&#62; &#60;option&#62;オプション4&#60;/option&#62; &#60;/select&#62; &#60;input type="submit"&#62; &#60;/form&#62; うまく選択不可になりました。 ところが Firefox では OK だったのですが、IE6では選択可能に。。。 調べてみると Disable Option&#8217;s In A Select (Dropdown) Element ? Post Archive ? www.lattimore.id.au It never ceases to amaze me how a browser like IE6, managed to not [...]]]></description>
			<content:encoded><![CDATA[<p>フォーム画面を動的に表示してある条件のときにはラジオボタンなどを disabled にしたりします。<br />
今回もあるフォームを作成していて在庫が0のときに select タグで表示する項目を選択できないようにしたかったので調べてみたところ、option タグにも disabled 属性がありました。</p>
<p>そこで下記のようにしてみたところ</p>
<pre class="code">&lt;form action=""&gt;
&lt;select&gt;
&lt;option&gt;オプション1&lt;/option&gt;
&lt;option disabled="disabled"&gt;オプション2&lt;/option&gt;
&lt;option&gt;オプション3&lt;/option&gt;
&lt;option&gt;オプション4&lt;/option&gt;
&lt;/select&gt;
&lt;input type="submit"&gt;
&lt;/form&gt;</pre>
<p><img src="http://www.syuhari.jp/blog/wp-content/uploads/option-disabled.gif" alt="option-desiabled" /></p>
<p>うまく選択不可になりました。<br />
ところが Firefox では OK だったのですが、IE6では選択可能に。。。</p>
<p>調べてみると<br />
<a href="http://www.lattimore.id.au/2005/06/18/disable-options-in-a-select-dropdown-element/" target="_blank" class="liexternal">Disable Option&#8217;s In A Select (Dropdown) Element ? Post Archive ? www.lattimore.id.au</a></p>
<blockquote><p>It never ceases to amaze me how a browser like IE6, managed to not implement something as trivial as an attribute like disabled. The IE team managed to implement it against the &lt;select&gt; element, but some how overlooked the &lt;option&gt; element. They implement the readonly attribute against the appropriate elements &#8211; yet some how the disabled attribute managed to be overlooked when they implemented it. More surprising is that, since the HTML4.01 specification came out in late 1999, IE has been updated and upgraded for various things literally hundreds of times. Why hasn’t this made it into an update? You’d begin to think that Microsoft aren’t aware of it, however the thought of that just seems too far fetched.</p></blockquote>
<p>どうも IE6 のバグのようです。</p>
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.syuhari.jp%2Farchives%2F59&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>]]></content:encoded>
			<wfw:commentRss>http://blog.syuhari.jp/archives/59/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

