61,112
社区成员
发帖
与我相关
我的任务
分享
index.html中 拆分成 iframe显示:
#content{
float: left;
}
<div id="content">
<iframe frameborder="0" src="/book?method=findAll" name="content";></iframe>
</div>
content.html:
li{
font:12px verdana, arial, sans-serif; /* 设置文字大小和字体样式 */
list-style:none; /* 将默认的列表符号去掉 */
padding:0px 5px;
margin:0; /* 将默认的外边距去掉 */
display:block;
float:left; /* 往左浮动 */
}
<ul>
<c:forEach items="${booklist}" var="book">
<li>
<a href="/book?method=book_detalis&b_id=${book.b_id}" ><img src="/${book.image_path}">
${book.name}<br>${book.price}</a>
</li>
</c:forEach>
</ul>
<html>
<head>
<meta charset="utf-8" />
<style>
#content{
float:left;
width: 500px;
height: 500px;
border:1px solid red;
}
#content iframe{
width: 500px;
height: 500px;
}
</style>
</head>
<body>
<div id="content">
<iframe frameborder="0" src="main.html" name="content"></iframe>
</div>
<ul>
<li><a href="test3.html" target="content">111</a></li>
</ul>
</body>
</html>
test3.html是我随便放的一个网页
main.html
<style>
div{
width: 500px;
height: 500px;
background-color:#ccc;
}
</style>
<div></div>
<html>
<head>
<meta charset="utf-8" />
<style>
#content{
float:left;
width: 500px;
height: 500px;
border:1px solid red;
}
#content iframe{
width: 500px;
height: 500px;
}
</style>
</head>
<body>
<div id="content">
<iframe frameborder="0" src="main.html" name="content"></iframe>
</div>
<ul>
<li><a href="test3.html" target="content">111</a></li>
</ul>
</body>
</html>
test3.html是我随便放的一个网页
main.html
<style>
div{
width: 500px;
height: 500px;
background-color:#ccc;
}
</style>
<div></div>
[/quote] 嗯 谢谢了哈。 我的页面很简单,我准备重新写一个了,你能把 css设置教我一下吗(html里设置 不用独立css文件)?。 index写3个框架 1.header.html是 网页头部 横条,写个标题。 2.navigator.jsp 左边竖条 放很多行的 文字 (是对content.jsp分类的链接) 3.content.jsp 除了header navigator,其他部分 都是显示 content了。 我看到网上 写着 float之类的 还有block属性的 搞得我设置得 越来越乱
.content iframe{
width:500px;
height:500px;
}
就大啦,具体大小可以自己调整
<html>
<head>
<style>
#header {
background-color:black;
text-align:center;
padding:3px;
}
#nav {
float: left;
line-height:30px;
background-color:black;
width:100px;
height:700px;
float:left;
padding:5px;
}
#content{
float:left;
width:50%;
height:50%;
}
#footer {
background-color:black;
clear:both;
text-align:center;
padding:5px;
}
</style>
</head>
<body>
<div id="header">
<iframe frameborder="0" src="/header.jsp" name="header"></iframe>
</div>
<div id="nav">
<iframe frameborder="0" src="/category?method=findAllCategory" name="nav"></iframe>
</div>
<div id="content">
<iframe frameborder="0" src="/book?method=findAll" name="content";></iframe>
</div>
<div id="footer">
<iframe frameborder="0" src="/footer.jsp" name="footer"></iframe>
</div>
</body>
</html>
index.html中 拆分成 iframe显示:
#content{
float: left;
width:50%; //这里的50%可以修改成你要的大小
height:50%; //这里的50%可以修改成你要的大小
}
<div id="content">
<iframe frameborder="0" src="/book?method=findAll" name="content";></iframe>
</div>
content.html:
li{
font:12px verdana, arial, sans-serif; /* 设置文字大小和字体样式 */
list-style:none; /* 将默认的列表符号去掉 */
padding:0px 5px;
margin:0; /* 将默认的外边距去掉 */
display:block;
float:left; /* 往左浮动 */
}
<ul>
<c:forEach items="${booklist}" var="book">
<li>
<a href="/book?method=book_detalis&b_id=${book.b_id}" ><img src="/${book.image_path}">
${book.name}<br>${book.price}</a>
</li>
</c:forEach>
</ul>