Top > 2006年10月
2006年10月03日
IEの条件付コメント
IEのみに反映させる条件付コメントです。
かなり便利です!
※通常のスタイルシートの外部リンクと一緒に使用すると◎。
IEの全てに読み込ませる。(IE5.x、IE6)
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="ie-all.css" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="ie-all.css" />
<![endif]-->
IE5.0のみ
<!--[if IE 5.0]>
<link rel="stylesheet" type="text/css" href="ie-50.css" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="ie-50.css" />
<![endif]-->
IE5.5のみ
<!--[if IE 5.5]>
<link rel="stylesheet" type="text/css" href="ie-55.css" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="ie-55.css" />
<![endif]-->
IE6.0のみ
<!--[if IE 6]>
<link rel="stylesheet" type="text/css" href="ie.6.css" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="ie.6.css" />
<![endif]-->
2006年10月02日
firefox marginのエラー
firefoxでのバグですが…背景画像がmarginに影響されてしまいます。
<div id="com01"><p>テキスト</p></div>
↓スタイルシートで#com01に背景を敷き、pでテキストを表示しています。
#com01{
background:url(images/01.gif) no-repeat top left;
height:170px;
width:780px;
}
#com01 p{
padding:40px 430px 40px 40px;
font-size:1.1em;
font-weight:bold;
}
↑
pのテキスト位置の設定を「margin」にすると画像がずれるのでpaddingで決定。