javaweb---静态网页开发技术(1)

1、笔记

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

2、实例

  • 简单的一个例子
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Insert title here</title>
    </head>
    <body>
        <table border="1">
            <tr>
                <th>我的校园</th>
                <th>校园生活</th>
                <th>我的家园</th>
            </tr>
            <tr>
                <th>计算中心</th>
                <th colspan="2" rowspan="4">
                    用户名:
                    <input type="text" name="name1">
                    <br>
                    密 码:
                    <input type="password" name="name2">
                    <br>
                    <button>确定</button>
                    <button>重置</button>
                </th>
            </tr>
            <tr><th>资环学院</th></tr>
            <tr><th>信息学院</th></tr>
            <tr><th>动科学院</th></tr>
        </table>
    </body>
</html>

其运行结果为:
在这里插入图片描述

  • 复杂的
    <补充>图像标签< img >:
    常见的图片格式:jpg、gif、png、bmp等等
    格式:
< img src="path" alt="text" title="text" width="x" height="y" />

其中:

src:图像的地址
alt:图像的替代文字
title:鼠标悬停提示文字
width:图像宽度
height:图像高度

<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>山东农业大学</title>
    </head>
    <body>
        <table border="1" width="810px" background="image/sdau.jpg" height="60px">
        <tr>
            <img src="image/sdau.jpg" width="810px" height="300px">
        </tr>
            <tr >
                <th>我的校园</th>
                <th>校园生活</th>
                <th>我的家园</th>
            </tr>
        </table>
        <table border="1" width="810px" height="120px">
            <tr bgcolor="blue" height="60px">
                <th>计算中心</th>
                <th colspan="2" rowspan="4">
                    用户名:
                    <input type="text" name="name1">
                    <br>
                    密  码:
                    <input type="password" name="name2">
                    <br>
                    <button>确定</button>
                    <button>重置</button>
                </th>
            </tr>
            <tr bgcolor="blue" height="60px"><th>资环学院</th></tr>
            <tr bgcolor="blue" height="60px"><th>信息学院</th></tr>
            <tr bgcolor="blue" height="60px"><th>动科学院</th></tr>
        </table>
    </body>
</html>

其运行结果是:
在这里插入图片描述
如果需要将表格居中只需在table中加

style="margin: 0px auto;"
//完整版:
<table border="1" style="margin: 0px auto;">
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值