JavaWeb第(1)部分:HTML和CSS

132 阅读2分钟

JavaEE的三层框架

image-20211023191213693

image-20211023191228675

image-20211023191245348

image-20211023191256310

HTML 和 CSS

1.HTML概述

###1.软件的结构

image-20211006103119792

###2.前端开发流程

image-20211006103253900

###3.网页的组成部分

image-20211006103424285

###4.HTML介绍

image-20211006103707992

5.创建HTML文件

image-20211006104441688

image-20211006104449853

6.HTML文件的编写规范

image-20211006105044851

image-20211006105138975

7.标签介绍

image-20211006111247691

image-20211006111346149

演示1:背景颜色加弹窗

image-20211006111436245

image-20211006111622098

演示2:换行(单标签br的作用)

image-20211006111523656

image-20211006111531568

2.HTML标签

1.标签语法

image-20211006113356248

2.font标签

image-20211006194442927

image-20211006194651176

3.特殊字符

image-20211006195002164

image-20211006195133559

image-20211006195147116

###4.标题标签

image-20211006195540825

image-20211006195550719

image-20211006195656126

5.超链接

image-20211006200155088

6.列表标签

image-20211007152110624

image-20211007152132343

7.img标签

image-20211007154420955

image-20211007154659070

8.表格标签

image-20211007160416058

9.表格的跨行跨列

image-20211007161627999

image-20211007161648568

10.iframe 框架标签

image-20211007163402782

image-20211007163409791

11.表单标签

标签作用
text文本框
password密码框,隐藏输入
radio选择框,单选name属性可以对其进行分组,同一组只能选一个 checked="checked"表示默认选中
checkbox多选打钩框
reset重置按钮 value属性修改按钮上的文本
submit提交按钮 value属性修改按钮上的文本
button就是个按钮 value属性修改按钮上的文本
file文件上传域
hidden隐藏域,也会提交,但是用户看不见
标签作用
select下拉选项
option标签是下拉列表框中的选项 selected="selected"设置默认选中
textarea表示多行文本输入框 (起始标签和结束标签中的内容是默认值) rows 属性设置可以显示几行的高度 cols 属性设置每行可以显示几个字符宽度
form标签就是表单

image-20211007170230742

<form>
    <h1 align="center">用户注册</h1>
    <table align="center">
        <tr>
            <td> 用户名称:</td>
            <td>
                <input type="text" value="默认值"/>
            </td>
        </tr>
        <tr>
            <td> 用户密码:</td>
            <td><input type="password" value="abc"/></td>
        </tr>
        <tr>
            <td>确认密码:</td>
            <td><input type="password" value="abc"/></td>
        </tr>
         <tr>
            <td>性别:</td>
            <td>
                <input type="radio" name="sex"/><input type="radio" name="sex" checked="checked"  /></td>
        </tr>
         <tr>
            <td> 兴趣爱好:</td>
            <td>
                <input type="checkbox" checked="checked" />Java
                <input type="checkbox" />JavaScript
                <input type="checkbox" />C++
            </td>
        </tr>
         <tr>
            <td>国籍:</td>
            <td>
                <select>
                    <option>--请选择国籍--</option>
                    <option selected="selected">中国</option>
                    <option>美国</option>
                    <option>日本</option>
                </select>
            </td>
        </tr>
         <tr>
            <td>自我评价:</td>
            <td><textarea rows="10" cols="20">我才是默认值</textarea></td>
        </tr>
         <tr>
            <td><input type="reset" /></td>
            <td align="center"><input type="submit"/></td>
        </tr>
    </table>
</form>

12.表单的提交

image-20211007173358386

Get请求的链接:

http://localhost:8080/?
action=login
&username=111
&password=222
&sex=boy
&hobby=java&hobby=js
&country=cn
&desc=asdsadas
post的请求链接:

http://localhost:8080/
<form action="http://localhost:8080" method="post">
    <input type="hidden" name="action" value="login" />
    <h1 align="center">用户注册</h1>
    <table align="center">
        <tr>
            <td> 用户名称:</td>
            <td>
                <input type="text" name="username" value="默认值"/>
            </td>
        </tr>
        <tr>
            <td> 用户密码:</td>
            <td><input type="password" name="password" value="abc"/></td>
        </tr>
         <tr>
            <td>性别:</td>
            <td>
                <input type="radio" name="sex" value="boy"/><input type="radio" name="sex" checked="checked" value="girl" /></td>
        </tr>
         <tr>
            <td> 兴趣爱好:</td>
            <td>
                <input name="hobby" type="checkbox" checked="checked" value="java"/>Java
                <input name="hobby" type="checkbox" value="js"/>JavaScript
                <input name="hobby" type="checkbox" value="cpp"/>C++
            </td>
        </tr>
         <tr>
            <td>国籍:</td>
            <td>
                <select name="country">
                    <option value="none">--请选择国籍--</option>
                    <option value="cn" selected="selected">中国</option>
                    <option value="usa">美国</option>
                    <option value="jp">小日本</option>
                </select>
            </td>
        </tr>
         <tr>
            <td>自我评价:</td>
            <td><textarea name="desc" rows="10" cols="20">我才是默认值</textarea></td>
        </tr>
         <tr>
            <td><input type="reset" /></td>
            <td align="center"><input type="submit"/></td>
        </tr>
    </table>
</form>

13.其他标签

image-20211007182745743

image-20211007182736366

3.CSS 概述

1.介绍

image-20211007183000310

2.语法规则

image-20211007183400719

image-20211007183427173

3.CSS和HTML的结合方式1

image-20211007184500823

image-20211007184334540

image-20211007184444848

4.结合方式2

image-20211007185033316

image-20211007185021616

image-20211007185056694

5.结合方式3

image-20211007185703502

image-20211007185711816

6.标签名选择器

image-20211007190539159

7.id选择器

image-20211008155920344

8.class类型选择器

image-20211008160319920

image-20211008160344257

###9.组合选择器

image-20211008160802920

image-20211008160754321

10.CSS的常用样式

image-20211008161459962 image-20211008161517370

image-20211008161558899

image-20211008161630041

image-20211008161646320

<head>
    <meta charset="UTF-8">
    <title>06-css常用样式.html</title>
    <style type="text/css">

        div{
            color: red;
            border: 1px yellow solid;
            width: 300px;
            height: 300px;
            background-color: green;
            font-size: 30px;
            margin-left: auto;
            margin-right: auto;
            text-align: center;
        }
        table{
            border: 1px red solid;
            border-collapse: collapse;
        }

        td{
            border: 1px red solid;
        }

        a{
            text-decoration: none;

        }

        ul{
            list-style: none;
        }

    </style>
</head>