1

ページの上部にこのテーブルがあります...

<table width="95%" border="0" cellspacing="0" cellpadding="0" style="position:fixed; z-index:99999;">
  <tr>
    <td><a href="index.php"><img src="logo.png" width="282" height="41" /></a></td>
    <td align="right">Hello <?php echo $_SESSION["forename"]; ?> | <a href="logout.php">Logout</a></td>
  </tr>
</table>

常にページの上部に表示されますが、下にスクロールすると、ページのすべてのコンテンツがテーブルの後ろに表示され、後ろに表示されます。

これが起こらないようにするために私ができることを誰かが知っていますか?

編集:これは私の完全なコードです...

<style type="text/css">
body,html {
    height:100%;
}
#top-bar {
    width:100%;
    padding:10px 10px 80px 10px;
    margin:0 0 100px 0;
    border-bottom:solid 1px #000000;
    top:0;
    left:0;
}
#left-bar {
    width:170px;
    display:inline;
    float:left;
}
#right-bar {
    width:80%;
    display:inline;
    float:right;
}
</style>
</head>

<body>
<div id="top-bar">
<table width="95%" border="0" cellspacing="0" cellpadding="0" style="position:fixed">
  <tr>
    <td><a href="index.php"><img src="logo.png" width="282" height="41" /></a></td>
    <td align="right">Hello <?php echo $_SESSION["forename"]; ?> | <a href="logout.php">Logout</a></td>
  </tr>
</table>
</div>

<div id="left-bar"><iframe src="header.php" width="180px" height="100%" frameborder="0" scrolling="no"></iframe></div>

<div id="right-bar">
<iframe name="rightiframe" src="dash.php" width="100%" height="100%" frameborder="0" scrolling="yes"></iframe>
</div>

</body>
4

1 に答える 1

1

あなたはおそらくこれを探しています:

<table width="95%" border="0" cellspacing="0" cellpadding="0" style="position:fixed;z-index:999;top:0;left:0;background-color:#fff">
  <tr>
    <td><a href="index.php"><img src="logo.png" width="282" height="41" /></a></td>
    <td align="right">Hello <?php echo $_SESSION["forename"]; ?> | <a href="logout.php">Logout</a></td>
  </tr>
</table>

テーブルのbackground-color後ろにあるコンテンツが見えないようにします。

JsFiddle: http://jsfiddle.net/CRHxk/

于 2013-03-14T20:16:12.083 に答える