lidaye2396

博客园 首页 新随笔 联系 订阅 管理

div

复制代码
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>

<head>
<style>
#header {
    background-color:black;
    color:white;
    text-align:center;
    padding:5px;
}
#nav {
    line-height:30px;
    background-color:#eeeeee;
    height:300px;
    width:100px;
    float:left;
    padding:5px;          
}
#section {
    width:350px;
    float:left;
    padding:10px;          
}
#footer {
    background-color:black;
    color:white;
    clear:both;
    text-align:center;
   padding:5px;          
}
</style>
</head>

<body>

<div id="header">
<h1>这里是标题</h1>
</div>

<div id="nav">
测试1<br>
测试2<br>
测试3<br>
</div>

<div id="section">
<h2>测试文本</h2>
<p>
这什么也不是没必要看
</p>
<p>
测试文本测试文本
</p>
</div>

<div id="footer">
测试文本
</div>

</body>
</html>
复制代码

这个的页面效果是这样的:

posted on 2020-11-11 11:11  lidaye2396  阅读(49)  评论(0编辑  收藏  举报