我希望创建一个内容页面,其中有两个iframe。一个iframe是浮动的侧边菜单,具有按钮或链接,而另一个iframe实际上包含内容。我希望用户能够点击侧边菜单上的链接,例如“图片”,然后使该链接更改另一个iframe的内容。我还希望鼠标悬停在每个菜单标签(图片、主页、阅读)上时,整个单元格的颜色都会改变。
我尝试了很多方法,但以下是代码的基础部分:
我尝试了很多方法,但以下是代码的基础部分:
<html>
<head>
<title>Main Content Page</title>
</head>
<body background="background.jpg">
<table>
<th>
<iframe src="sidebar.html" frameborder="no" border="0" scrolling="no" height="750" width="450"></iframe>
<th>
<iframe id ="content" src="" frameborder="no" border="0" scrolling="no" width="600" height="800"></iframe>
</table>
</body>
</html>
然后,内容 iframe 的页面就不重要了。侧边栏的代码如下:
<html>
<head>
<title>Main</title>
<base target="content">
<style type="text/css">
body{bgcolor: black;}
a{color: white}
a:link, a:visited{background-color: black}
<!--a:hover{background-color: gray}-->
<!--td:hover{background-color: gray}-->
buttons:hover{background-color: gray}
td, th{border:1px solid black; background-color:black;}
table{border:1px solid gray;}
td {font-family: Kunstler Script; color: white; font-size: 72; padding:15px;}
</style>
</head>
<body>
<table align="center">
<tr><div class="buttons"><div><td onclick="target.content.home.href='html'">Home</div>
<tr><div><td onclick="target.content.href='images.html'">Images</div>
<tr><div><td onclick="target.content.href='readings.html'">Readings</div></div>
</table>
</div>
</body>
</html>
目前链接不可用,但按钮会改变颜色。