Notes -JavaWeb learning journey 6

Table tags:

table: define tables

width: width

border: Borders

cellpadding: and define the content of the cell from

Define the distance between the cells: cellspacing

bgcolor: background color

tr: definition line --- property may be defined with a background color, alignment, and

td: define the cell ----- colspan: merged column rowspan: merging line

th: define header cell

: Table title

: Indicates the first part of the table

: A table showing the body part

: That part of the foot of the table

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表格标签</title>
</head>
<body>
    <!--borer边框-->
    <!--width 表格宽度-->
    <table border="1" width="50%" cellpadding="0" cellspacing="0" bgcolor="#006400">
        <thead> <!--表示表格头部分,不会在页面中有任何的样式-->
        <caption>学生信息表</caption>
        <tr>
            <th>编号</th>
            <th>姓名</th>
            <th>成绩</th>
        </tr>
        </thead>

        <tbody><!--表示表格的身体部分-->
        <tr bgcolor="#b22222">
            <td>1</td>
            <td>小龙女</td>
            <td>100</td>
        </tr>
        </tbody>

        <tfoot>
        <tr>
            <td>2</td>
            <td>杨过</td>
            <td>50</td>
        </tr>
        </tfoot>
    </table>
</body>
</html>
Travel case columns exercises
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>旅游网</title>
</head>
<body>
    <table  width="100%" align="center">
        <!--第一行-->
        <tr>
            <td>
                <img src="tupian/image/top_banner.jpg" width="100%" alt="">
            </td>
        </tr>
        <!--第二行-->
        <tr>
            <td>
                <table width="100%" align="center">
                    <tr>
                        <td>
                            <img src="tupian/image/logo.jpg" alt="">
                        </td>

                        <td>
                            <img src="tupian/image/search.png" alt="">
                        </td>

                        <td>
                            <img src="tupian/image/hot_tel.jpg" alt="">
                        </td>
                    </tr>
                </table>
            </td>

        </tr>
        <!--第三行-->
        <tr>
            <td>
                <table width="100%" align="center" bgcolor="#ffd700">
                    <tr align="center" height="45">
                        <td>
                            <a href="https://www.cnblogs.com/train99999/">首页</a>
                        </td>
                        <td>
                            门票
                        </td>
                        <td>
                            酒店
                        </td>
                        <td>
                            香港车票
                        </td>
                        <td>
                            出境游
                        </td>
                        <td>
                            国内游
                        </td>
                        <td>
                            港澳游
                        </td>
                        <td>
                            报团定制
                        </td>
                        <td>
                            全球自由行
                        </td>
                        <td>
                            收藏排行榜
                        </td>

                    </tr>
                </table>
            </td>
        </tr>
        <!--第四行-->
        <tr>
            <td>
                <img src="tupian/image/banner_3.jpg" alt="">
            </td>
        </tr>
        <!--第五行-->
        <tr>
            <td>
                <img src="tupian/image/icon_5.jpg" alt="">
                精选
                <hr color="#ffd700">
            </td>
        </tr>
        <!--第六行-->
        <tr>
            <td>
                <table align="center" width="95%">
                    <tr>
                        <td>
                            <img src="tupian/image/jiangxuan_1.jpg" alt="">
                            <p>上海飞三亚五天4晚自由行(春节销售+亲子+蜜月+自由行)</p>
                            <font color="red">&yen;899</font>
                        </td>
                        <td>
                            <img src="tupian/image/jiangxuan_1.jpg" alt="">
                            <p>上海飞三亚五天4晚自由行(春节销售+亲子+蜜月+自由行)</p>
                            <font color="red">&yen;899</font>
                        </td>
                        <td>
                            <img src="tupian/image/jiangxuan_1.jpg" alt="">
                            <p>上海飞三亚五天4晚自由行(春节销售+亲子+蜜月+自由行)</p>
                            <font color="red">&yen;899</font>
                        </td>
                        <td>
                            <img src="tupian/image/jiangxuan_1.jpg" alt="">
                            <p>上海飞三亚五天4晚自由行(春节销售+亲子+蜜月+自由行)</p>
                            <font color="red">&yen;899</font>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <!--第七行-->
        <tr>
            <td>
                <img src="tupian/image/icon_6.jpg" alt="">
                国内游
                <hr color="#ffd700">
            </td>
        </tr>
        <!--第八行-->
        <tr>
            <td>
                <table align="center" width="95%">
                    <tr>
                        <td rowspan="2">
                            <img src="tupian/image/guonei_1.jpg" alt="">
                            <p>上海飞三亚五天4晚自由行(春节销售+亲子+蜜月+自由行)</p>
                            <font color="red">&yen;699</font>
                        </td>
                        <td>
                            <img src="tupian/image/jiangxuan_2.jpg" alt="">
                            <p>上海飞三亚五天4晚自由行(春节销售+亲子+蜜月+自由行)</p>
                            <font color="red">&yen;699</font>
                        </td>
                        <td>
                            <img src="tupian/image/jiangxuan_2.jpg" alt="">
                            <p>上海飞三亚五天4晚自由行(春节销售+亲子+蜜月+自由行)</p>
                            <font color="red">&yen;699</font>
                        </td>
                        <td>
                            <img src="tupian/image/jiangxuan_2.jpg" alt="">
                            <p>上海飞三亚五天4晚自由行(春节销售+亲子+蜜月+自由行)</p>
                            <font color="red">&yen;699</font>
                        </td>
                    </tr>

                    <tr>

                        <td>
                            <img src="tupian/image/jiangxuan_2.jpg" alt="">
                            <p>上海飞三亚五天4晚自由行(春节销售+亲子+蜜月+自由行)</p>
                            <font color="red">&yen;699</font>
                        </td>
                        <td>
                            <img src="tupian/image/jiangxuan_2.jpg" alt="">
                            <p>上海飞三亚五天4晚自由行(春节销售+亲子+蜜月+自由行)</p>
                            <font color="red">&yen;699</font>
                        </td>
                        <td>
                            <img src="tupian/image/jiangxuan_2.jpg" alt="">
                            <p>上海飞三亚五天4晚自由行(春节销售+亲子+蜜月+自由行)</p>
                            <font color="red">&yen;699</font>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <!--第九行-->
        <tr>
            <td>
                <img src="tupian/image/icon_7.jpg" alt="">
                境外游
                <hr color="#ffd700">
            </td>
        </tr>
        <!--第十行-->
        <tr>
            <td>
                <table align="center" width="95%">
                    <tr>
                        <td rowspan="2">
                            <img src="tupian/image/jiangwai_1.jpg" alt="">
                            <p>上海飞三亚五天4晚自由行(春节销售+亲子+蜜月+自由行)</p>
                            <font color="red">&yen;699</font>
                        </td>
                        <td>
                            <img src="tupian/image/jiangxuan_3.jpg" alt="">
                            <p>上海飞三亚五天4晚自由行(春节销售+亲子+蜜月+自由行)</p>
                            <font color="red">&yen;699</font>
                        </td>
                        <td>
                            <img src="tupian/image/jiangxuan_3.jpg" alt="">
                            <p>上海飞三亚五天4晚自由行(春节销售+亲子+蜜月+自由行)</p>
                            <font color="red">&yen;699</font>
                        </td>
                        <td>
                            <img src="tupian/image/jiangxuan_3.jpg" alt="">
                            <p>上海飞三亚五天4晚自由行(春节销售+亲子+蜜月+自由行)</p>
                            <font color="red">&yen;699</font>
                        </td>
                    </tr>

                    <tr>

                        <td>
                            <img src="tupian/image/jiangxuan_3.jpg" alt="">
                            <p>上海飞三亚五天4晚自由行(春节销售+亲子+蜜月+自由行)</p>
                            <font color="red">&yen;699</font>
                        </td>
                        <td>
                            <img src="tupian/image/jiangxuan_3.jpg" alt="">
                            <p>上海飞三亚五天4晚自由行(春节销售+亲子+蜜月+自由行)</p>
                            <font color="red">&yen;699</font>
                        </td>
                        <td>
                            <img src="tupian/image/jiangxuan_3.jpg" alt="">
                            <p>上海飞三亚五天4晚自由行(春节销售+亲子+蜜月+自由行)</p>
                            <font color="red">&yen;699</font>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <!--第十一行-->
        <tr>
            <td>
                <img src="tupian/image/footer_service.png" width="100%">
            </td>
        </tr>
        <tr>
            <td align="center" bgcolor="#ffd700">
                <font color="gray" size="2">
                    嘻嘻嘻嘻嘻有限公司
                    版权所有Copyright 2006-2019&copy;,All Right Reserverd 苏ICP备16007882
                </font>
            </td>
        </tr>
    </table>
</body>
</html>

img

HTML tags: form tag

Form: means for collecting data input by the user and the server for interaction

from :用于定义表单的,可以定义一个范围,范围代表采集用户数据的范围

from tag has two attributes:

action-- specify the URL to submit data,

method: specify submission, submission in seven, there are two more commonly used, one get, one post,

get: Request parameter in the address bar, a request parameter size is limited, unsafe

post: request parameters are not displayed in the address bar, request parameters unlimited size, safety

Data in the form of order is submitted, you must specify the name attribute

Form Item Tags:
  1. input: by the type attribute, change the style of display elements

    property type:

    text: defaults text input box, type attributes

    password: password input box, hidden text input when specifying the property

    radio: radio button, check box to get more radio to achieve the effect, the name attribute values ​​of multiple checkbox must be the same, usually a single box provides value for each attribute that specifies which was selected after value, checked attribute submitted, you can specify a default value

    checkbox: check box, and generally give every single box provides value property, the specified value, checked attribute was selected after submitting, you can specify a default value

    file: File check box

    hidden: hidden fields

    Button: submit (submit button, you can submit the form), button (push button), image (picture submit button)

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>表单项标签</title>
    </head>
    <body>
        <form>
            用户名:<input type="text" name="username" placeholder="请输入用户名"><br>
            密码:<input type="password" name="password"><br>
            性别:<input type="radio" name="gender" value="male"> 男
                <input type="radio" name="gender" value="female">女<br>
            爱好:<input type="checkbox" name="hobby" value="shopping"> 逛街
                <input type="checkbox" name="hobby" value="java"> Java
                <input type="checkbox" name="hobby" value="game"> 游戏
                <br>
            图片:<input type="file" name="file"><br>
            生日:<input type="datetime-local" name="birthday"><br>
            邮箱:<input type="email" name="email"><br>
            <input type="submit" value="登录">
    
    
        </form>
    </body>
    </html>
    img

img

Registration Case Exercises
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <form action="#" method="post">
        <table border="1" align="center" width="500">
            <tr>
            <td><label for="username">用户名</label></td>
            <td><input type="text" name="username" id="username"></td>
            </tr>
            <tr>
                <td><label for="password">密码</label></td>
                <td><input type="password" name="username" id="password"></td>
            </tr>
            <tr>
                <td><label for="email">Email</label></td>
                <td><input type="email" name="username" id="email"></td>
            </tr>
            <tr>
                <td><label for="name">姓名</label></td>
                <td><input type="text" name="username" id="name"></td>
            </tr>
            <tr>
                <td><label for="tel">手机号</label></td>
                <td><input type="text" name="username" id="tel"></td>
            </tr>
            <tr>
                <td>性别</td>
                <td><input type="radio" name="gender"  value="male">男
                    <input type="radio" name="gender"  value="female">女</td>
            </tr>
            <tr>
                <td><lable for="date">出生年月</lable></td>
                <td><input type="date" name="date" id="date"></td>
            </tr>
            <tr>
                <td><lable for="checkcode">验证码</lable></td>
                <td><input type="text" name="date" id="checkcode">
                    <img src="verify_code.jpg">
                </td>
            </tr>
            <tr>
                <td colspan="2" align="center"><input type="submit" value="注册"></td>
            </tr>

        </table>
    </form>
</body>
</html>
2.select: drop-down list

Child elements: option, the specified list item

3.textarea: text fields

cols: Specifies the number of columns, the number of characters per line

rows: Default how many rows

CSS: Cascading Style Sheets Cascading Style Sheet

Use of CSS: css and html binding mode

1. The inline style: style attribute specifies css code in the tag

2. Internal style: in the head tag, the tag body content definition style tags, style css code label is

3. External style: css resource file defined in the head tag, tag link defined, the introduction of external resource files

img

img

img

CSS syntax:

Selector{

Attribute 1: 2 Property Value;

Attribute 2: Property Value 2;

​ ....

}

Selector: selection element having similar characteristics

Selector:

classification:

1. Basic selector

  1. id selector: selecting a specific element of id attribute value,
  2. Selector element: selecting elements with the same label name
  3. Class selector: selecting a value of the same class attribute selector

2. Extended selector

  1. Select all elements: *} {

  2. And set the selector: 1 selectors, select {2}

  3. Child selector: Filter element 2 at the selector element selector 1 ---- "Selector Selector 2 {1}

  4. Parent Selector: filter selector selecting a parent element 2 ---- 1 "Selector 1> selector {2}

  5. Attribute selection: Select element element name, attribute name = attribute value ---- "attribute name [attribute name =" attribute value "]

  6. Pseudo-class selection: Select some elements having a state ---- "element: {Status}

    Status: link: initialization state visited: visited state active: hover state of being accessed; mouse suspended state

Attributes:
  1. Fonts, text: font-size; font size, text color Color- text-align: alignment of the line-height: Row Height
  2. Background: background
  3. Border: border
  4. Size: width: Width, height: Height
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        p{
            color:green;
            font-size:30px;
            text-align:center;
            line-height: 100px;

            border: 1px solid pink;
        }
        div{
            border: 1px solid;
            height: 200px;
            width: 200px;
            background: url("img/1_Adam_4k.jpg" );
        }
    </style>
</head>
<body>
    <P>云想衣裳花想容</P>
    <div></div>
</body>
</html>
Box model

margin: Margin padding: padding

float: Floating (left, right)

CSS registered cases

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        *{
            margin:0px;
            padding: 0px;
            box-sizing:border-box;
        }
        body{
            background: url("img/register_bg.png") no-repeat center;
        }
        .rg_layout{
            width: 900px;
            height: 500px;
            border: 8px solid #EEEEEE ;
            /*让div背景白色*/
            /*让div水平居中*/
            background: white;
            margin: auto;
            margin-top: 15px;
        }
        .rg_left{

            float:left;
            margin:15px;
        }
        .rg_center{
            border:1px solid red;
            float: left;
            width:450px;

        }
        .rg_right{

            float: right;
        }
        .p_reg{
            color:#FFD026;
            font-size:20px;
        }
        .p_ur{
            color:#A6A6A6;
            font-size:20px;
        }
        .td_left{
            width:100px;
            text-align: right;
            height: 45px;
        }
        .td_right{
            padding-left: 50px;
        }
        #username,#password,#email,#tel,#name,#birthday,#checkcode{
            width:251px;
            height:32px;
            border:1px solid #A6A6A6;
            border-radius:5px;
            padding-left:10px
        }
        #btn_sub{
            width:150px;
            height:40px;
            background: #FFD026;
            border:1px solid;
        }
    </style>
</head>
<body>
    <div class="rg_layout">
        <div class="rg_left">
            <p class="p_reg">新用户注册</p>
            <p class="p_ur">USER REGISTER</p>
        </div>

        <div class="rg_center">
            <table>
                <tr>
                    <td class="td_left"><label for="username">用户名</label></td>
                    <td class="td_right"><input type="text" name="username" id="username" placeholder="请输入用户名"></td>
                </tr>

                <tr>
                    <td class="td_left"><label for="password">密码</label></td>
                    <td class="td_right"><input type="password" name="password" id="password" placeholder="请输入密码"></td>
                </tr>

                <tr>
                    <td class="td_left"><label for="email">Email</label></td>
                    <td class="td_right"><input type="email" name="email" id="email" placeholder="请输入邮箱"></td>
                </tr>

                <tr>
                    <td class="td_left"><label for="name">姓名</label></td>
                    <td class="td_right"><input type="text" name="name" id="name" placeholder="请输入姓名"></td>
                </tr>

                <tr>
                    <td class="td_left"><label for="tel">手机号</label></td>
                    <td class="td_right"><input type="text" name="tel" id="tel" placeholder="请输入手机号"></td>
                </tr>

                <tr>
                    <td class="td_left"><label>性别</label></td>
                    <td class="td_right">
                        <input type="radio" name="gender" value="male"> 男
                        <input type="radio" name="gender" value="female"> 女
                    </td>
                </tr>

                <tr>
                    <td class="td_left"><label for="birthday">出生日期</label></td>
                    <td class="td_right"><input type="date" name="birthday" id="birthday" placeholder="请输入出生日期"></td>
                </tr>

                <tr>
                    <td class="td_left"><label for="checkcode" >验证码</label></td>
                    <td class="td_right"><input type="text" name="checkcode" id="checkcode" placeholder="请输入验证码">
                        <img src="img/verify_code.jpg">
                    </td>
                </tr>


                <tr>
                    <td colspan="2" align="center"><input type="submit" id="btn_sub" value="注册"></td>
                </tr>
            </table>
        </div>

        <div class="rg_right">
            <P >已有账号?<a href="#">立即登录</a></P>
        </div>
    </div>
</body>
</html>

img

Guess you like

Origin www.cnblogs.com/train99999/p/10976878.html