CSS overflowで縦だけスクロール

2009年10月14日(水)

縦だけスクロールのやり方をいつも忘れるので。
IE6でさえちゃんといってたので、大丈夫かなと。
最近は検証してないです。

overflow:auto;
overflow-y:scroll;

PHP phpファイルをcssで出力

2009年09月09日(水)

phpファイルをcssで出力する場合のContent-typeです。

header("Content-type: text/css");

このphpでcssを記述する方法はキャッシュされないので読み込みに時間がかかります。

header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT');

これでキャッシュされるはずらしいのですが・・・。

cssのborderショートハンド

2009年06月05日(金)

ホントに知らない事って多いんですね。

/*ボーダーの幅設定*/
border-width: 2px 3px 1px 2px;
border-style:dotted solid solid dotted;
border-color: red #999 red #0c5633;

/*こんな書き方も*/
border-right-color: #999;
border-bottom-color: red;
border-left-color: #0c5633;

!important

2009年05月24日(日)

Style sheet designers can increase the weights of their declarations:

H1 { color: black ! important; background: white ! important }
P  { font-size: 12pt ! important; font-style: italic }

In the example above, the first three declarations have increased weight, while the last declaration has normal weight.

A reader rule with an important declaration will override an author rule with a normal declaration. An author rule with an important declaration will override a reader rule with an important declaration.

http://www.w3.org/TR/REC-CSS1/#important

要するに、! importantがある属性は、後からのオーバーライドを無視します
といった内容だと。

syntaxhighlighterのCSSを変更しようと試みたときにふと気づきました。
!importantってなんじゃらほいと。
よくみるのですが、CSSをずいぶんおざなりにしていたせいでしょうか。
すっかり存じ上げませんでした。

overflow-y

2009年05月14日(木)

なぜかいつも忘れるので

overflow:auto;
overflow-y:scroll;

IE独自だそうですが、何かと重宝するので。
ただ、ほんとは嫌です。見ただけで吐き気がします「IE独自」