2011年2月21日月曜日

XHTML 1.0 Strict - テンプレート

XHTML 1.0 Strict

source
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
  <title>XHTML 1.0 Strict</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <style type="text/css">/* @import url(""); */</style>
</head>
<body>
<h1>XHTML 1.0 Strict</h1>
</body>
</html>

Preview

iframe

XHTML 1.1 - テンプレート

XHTML 1.1

source
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
  <title>XHTML 1.1</title>
  <style type="text/css">/* @import url(""); */</style>
</head>
<body>
<h1>XHTML 1.1</h1>
</body>
</html>

Preview

iframe

2011年2月17日木曜日

a 要素を button 要素の代わりに使う

注意点

  • ポインターが a.button の上にあるときのセレクタ a.button:hover は効かないけれど a#button:hover は Ok
    ※ 確認: ie7, firefox3.6.13

検証

iframe

iframe の contentWindow.document

Source
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
 <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
 <title>a element button</title>
 <style id="button" type="text/css">
  a.button, span.button, #button, #class { display:inline-block; }
  .button a, a.button { text-decoration:none; }
  a.button span, span.button a { display:block; }
  a.button span, span.button a, a#button, a#class {
   font-size:80%;
   font-weight:bold;
   padding:0.2em 0.5em;
   cursor:default;

   border:solid 1px gray;
   background-color:#ccc;
   color:gray;
  }
  a.button span:hover, span.button a:hover, a#button:hover, a.button:hover {
   border-color:#444;
   background-color:white;
   color:black;
  }
 </style>
 <style type="text/css">
  body { font-family:arial,sans-serif; }
  h1 { font-size:100%; }
  ul li { margin-bottom:1px; }
 </style>
</head>
<body>
 <h1>a element button</h1>
 <ul>
  <li><span class="button"><a onclick="this.parentNode.parentNode.innerHTML+='!';">span.button&gt;a</a></span></li>
  <li><a class="button" onclick="this.parentNode.innerHTML+='!';"><span>a.button&gt;span</span></a></li>
  <li><a class="button" id="button" onclick="this.parentNode.innerHTML+='!';">a#button</a></li>
  <li><a class="button" id="class" onclick="this.parentNode.innerHTML+='!';">a.button</a></li>
 </ul>
</body>
</html>

2011年2月15日火曜日

ブックマックレット

RequestPolicy で google.com 検索結果のリンクからリダイレクトできないとき

  • javascript:var d=document,u=d.getElementsByTagName('noscript').item(0).innerHTML.split("'")[1];d.body.innerHTML='<p style="text-align:center;"><a href="'+u+'">'+u+'</a></p>';

2011年2月14日月曜日

css で注意すること

そのつど更新

display:inline-block は inline 要素なので、既定の vertical-align:baseline だと、要素の下のほうに英文字の g のように線がベースラインの下まで出るためのスペースが確保されるので vertical-align:top で対処する。

  • iframe
  • object

block 要素の中の block 要素を position:absolute や float:left すると親 block 要素の高さが 0 になるので、height を指定して対処する。

2010年11月8日月曜日

Windows Live Mail のレジストリ掃除

IE7 などの data: スキームがサポートされていないブラウザの場合

  • 下記の内容をコピー
  • テキストエディタへ貼り付け
  • エンコードをボムつきの UTF16LEで、拡張子を .reg として保存
livemail_clean.reg
Windows Registry Editor Version 5.00

[-HKEY_CURRENT_USER\Software\Microsoft\IdentityCRL\OfflineCreds]
[-HKEY_CURRENT_USER\Software\Microsoft\IdentityCRL\UserExtendedProperties]
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\UnreadMail]
[-HKEY_CURRENT_USER\Software\Microsoft\Windows Live Mail\PerPassportSettings]


[HKEY_CURRENT_USER\Software\Microsoft\IdentityCRL\OfflineCreds]
[HKEY_CURRENT_USER\Software\Microsoft\IdentityCRL\UserExtendedProperties]
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\UnreadMail]
[HKEY_CURRENT_USER\Software\Microsoft\Windows Live Mail\PerPassportSettings]

IE8 や Firefox3 などの data スキーマに対応しているブラウザなら

  • livemail_clean.reg を名前をつけて保存
  • 拡張子を .reg に
  • ファイルのプロパティを開いて [ブロックの解除(K)]

2010年10月28日木曜日

jEdit の環境設定 - その 2 (コンテキストメニューの解除)

テキストではないファイルのアイコンを右クリックしたときも [Open with jEdit] がコンテキストメニューに入っていて煩わしいので削除したい。

とりあえず検索してみると……発見。
http://marc.info/?l=jedit-users&m=118434448102638

'Re: [ jEdit-users ] "Open With" jEdit context menu in explorer' - MARC
 :
HKCR->*->Shell->Open With jEdit

Just call "regedit" from the Run... command and delete that Key
 :

とのことなので、念のためにレジストリをエクスポートして、
削除。

[HKEY_LOCAL_MACHINE]
  - [SOFTWARE]
    - [Classes]
      - [*]
        - [Shell]
          + [Open with jEdit]

確認

  • jEdit 4.3.2 server mode, using Java 1.6.0_21
    Windows XP Professional 2003 Service Pack 3