擬似フレームページ

frame で切られたページは最近様々な理由で敬遠されてきており、 替わって、CSS でレイアウトされたページがポピュラーになってきている。 しかし、IEとFirefoxなどでCSSの解釈が異なるために、 うまくレイアウトが効かず苦労すると。

その末たどり着いたレイアウトを、以下にメモ。

これなら、Firefox でも バカIE6 でも同じように表示される。 標準モードでも後方互換モードでもどちらでもOK。

ヘッダ、フッタ、コンテンツ のパターン

Everything is expanded.Everything is shortened.
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<style type="text/css">
html, body {
    margin: 0; padding: 0;
}
html body {
    padding-top: 77px;
    padding-bottom: 45px;
    overflow: hidden;
}
 
#contentsHeader {
    position: absolute;
    z-index: 1;
    left: 0px;
    top: 0px;
    background-color: #ff8888;/* わかりやすくするため */
    width:100%;
    height: 77px;
}
 
#contentsBody {
    position: relative;
    overflow: auto;
    z-index: 0;
    width:100%;
    height: 100%;
    background-color: #88ff88;/* わかりやすくするため */
}
 
#contentsFooter {
    position: absolute;
    z-index: 1;
    left: 0px;
    bottom: 0px;
    width: 100%;
    height: 45px;
    background-color: #8888ff;/* わかりやすくするため */
}
</style>

ヘッダやフッタの高さはお好みで調整可。

ヘッダ、フッタ、左コンテンツ、右コンテンツ のパターン

Everything is expanded.Everything is shortened.
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<style type="text/css">
html, body {
    margin: 0; padding: 0;
}
html body {
    padding-top: 77px;
    padding-bottom: 45px;
    overflow: hidden;
}
 
#contentsHeader {
    position: absolute;
    z-index: 1;
    left: 0px;
    top: 0px;
    background-color: #ff8888;/* わかりやすくするため */
    width:100%;
    height: 77px;
}
 
#contentsBody {
    position: relative;
    overflow: auto;
    z-index: 0;
    width:100%;
    height: 100%;
    background-color: #88ff88;/* わかりやすくするため */
}
 
#contentsFooter {
    position: absolute;
    z-index: 1;
    left: 0px;
    bottom: 0px;
    width: 100%;
    height: 45px;
    background-color: #8888ff;/* わかりやすくするため */
}
 
#contentsLeft {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 120px;
    height: 100%;
    background-color: #ffcccc;/* わかりやすくするため */
}
 
#contentsRight {
    position: absolute;
    top: 0px;
    left: 120px;
    height: 100%;
    background-color: #ccccff;/* わかりやすくするため */
}
 
 
</style>

上記のサンプル


MLEXP. Wiki


添付ファイル: filesample_css_menu.html 3265件 [詳細] filesample_css.html 3316件 [詳細] fileframe_sample.zip 2273件 [詳細]

トップ   編集 凍結解除 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2010-05-15 (土) 12:08:16 (5085d)