Front-end basis -html, css

Front-end content:

html5: page architecture

css3: Page Layout

JavaScript (focus): page interaction

In addition:

jquery (Kit): js toolkit

bootstrap (framework): fast page framework to build

html5

1.html: HTML, containing text, images, audio, video, hyperlinks

canvas (micro-channel small game development program)

2. Composition: the escape character, instructions, labels

3. Objective: To complete page framework to build, what kind of label labels complete nesting relationship

Escape character

And is &; package, the contents of the special letters or numbers

1.空格: 
2.":"
3.&:&
4.<:&lt;
5.>:&gt;
6.版权:&copy;

instruction

Is <> wrapped to! The beginning of the special symbols, called instruction.

1.文档类型:<!doctype html>
2.注释:<!-- -->

label

Is <> wrapped, beginning with the letters, numbers, and minus may comprise -

1.系统标签:h1~h6、p、sapn、div、i、p、a、img、hr、br、table、form、input
2.自定义标签:满足合法命名的所有标签

Commonly used tags

basis

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>标签</title>
</head>
<body>
    <!-- 1、标题:加粗 -->
    <!--重点:h1标签的语义:是该页面的主标题-->
    <h1 title="这是标题">一级标题</h1>
    <h2>二级标题</h2>
    <h6>六级标题</h6>
    正文文本 <br>
    正文文本

    <!--2、段落: 自带换行,有段落间距-->
    <p>这是一个段落这是一个段落这是一个段落这是一个段落</p>
    <p>这是一个段落这是一个段落这是一个段落这是一个段落</p>

    <!--3、换行标签-->
    正文文本 <br>
    正文文本 <br>

    <!--自带换行的文本标签:h1~h6 p -->
    <!--4、文本类型标签:不自带换行的文本标签 - span i b -->
    <span>span</span>
    <span>span</span>
    <b>加粗标签</b>
    <b>加粗标签</b>
    <strong>以加粗作为强调的强调标签</strong>
    <strong>以加粗作为强调的强调标签</strong>
    <i>斜体标签</i>
    <i>斜体标签</i>
    <em>以斜体作为强调的强调标签</em>
    <em>以斜体作为强调的强调标签</em>
    <br>
    <span>一般用来嵌套其它文本类标签 上<sup>角标</sup> 下<sub>角标</sub> </span>

    <!--5、超链接标签-->
    <a href="https://www.baidu.com" target="_blank">前往百度</a>
    <br>

    <!--6、图片标签-->
    <!--title:鼠标悬浮的文本提示-->
    <!--alt:img标签资源加载失败-->
    <img title="这是二哈" alt="二哈" src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=2969644141,2516639069&fm=26&gp=0.jpg">

    <!--7、列表标签: 无序ul>li 有序ol>li -->
    <!--ul>li{第$列}*5-->
    <ul>
        <li>第1列</li>
        <li>第2列</li>
        <li>第3列</li>
        <li>第4列</li>
        <li>第5列</li>
    </ul>

    <!--8、表格标签 table>tr>th|td -->
    <!--tr:行 th:标题单元格 td:普通单元格 -->
    <!--border:边框-->
    <!--cellspacing:单元格的间距,最小为0,
    但是单元格之间是两条线,可以用rules="all" 处理成一条线 -->
    <!--cellpadding:单元格的内边距(文本与标签的间距)-->
    <table border="1" width="500" height="300" rules="all" cellspacing="0" cellpadding="10">
        <caption>表格标题</caption>
        <thead>
            <tr>
                <!--th{标题}*3-->
                <th>标题</th>
                <th>标题</th>
                <th>标题</th>
            </tr>
        </thead>
        <tbody>
            <!--(tr>td{单元格}*3)*2-->
            <!--rowspan:合并行-->
            <!--colspan:合并列-->
            <tr>
                <td rowspan="2">单元格</td>
                <td colspan="2">单元格</td>
            </tr>
            <tr>
                <!--<td>单元格</td>-->
                <td>单元格</td>
                <td>单元格</td>
            </tr>
        </tbody>
        <tfoot>
            <tr>
                <td>表尾表尾</td>
                <td>表尾表尾</td>
                <td>表尾表尾</td>
            </tr>
        </tfoot>
    </table>

    <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
</body>
</html>

Forms

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>表单标签</title>
</head>
<body>
    <!--1、form的作用:完成前后台数据的交互的 - 将用户录入的信息提交给后台 | 文件上传 -->
    <form action="">
        <p>
            <!--label作为input的文本解释标签,for绑定id-->
            <!--value属性是表单标签的内容,就是提交给后台的-->
            <!--name是提交给后台的key,value是值-->
            <!--placeholder是文本占位符-->
            <!--type是决定标签的类型本质(input|button)-->
            <!--multiple,checked布尔类型属性,不需要写值,multiple多选 checked默认激活-->
            <label for="username">账号:</label>
            <input id="username" type="text" value="Owen" name="usr">
        </p>
        <p>
            <label for="password">密码:</label>
            <input id="password" type="password" placeholder="请输入密码" name="pwd">
        </p>
        <p>
            <input type="hidden" value="123asd{asdf2q1})sdf12" name="pk">
        </p>
        <p>
            <input type="file" name="file" multiple>
        </p>
        <p>
            男<input type="radio" value="male" name="sex" checked>
            女<input type="radio" value="female" name="sex">
        </p>
        <p>
            男<input type="checkbox" value="male" name="hobby" checked>
            女<input type="checkbox" value="female" name="hobby" checked>
            哇塞<input type="checkbox" value="other" name="hobby">
        </p>
        <p>
            <button type="button">普通按钮</button>
            <button type="reset">重置按钮</button>
            <button type="submit">提交按钮</button>
        </p>
        <p>
            <textarea cols="30" rows="10"></textarea>
        </p>
        <p>
            <input type="button" value="按钮" />
            <input type="reset" value="重置" />
            <input type="submit" value="登录" />
        </p>
    </form>
</body>
</html>

Classification and labeling

1. Are wrap comes with:

Tape wrap: h1, p, div, table, form, tr, ul, li;

Without wrap: sapn, i, b, a, img, input, button, label, textarea

2. Mono Tags:

Single-label (main function): br, hr, input, img, link;

Ditag (primary content): html, head, body, h1, p, span, div, a, label, button

End / representative of a label, but a single label may be omitted

3. The combination of tags:

组合:ul>li、table>tr>td|th、form>input

css3

What is the css: Cascading Style Sheets, is a markup language, there is no logic

css style is completed with the layout of the page

Learning content: css How to control html tags

css introduced three kinds of ways

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>css的引入</title>
    <!--2、内联式-->
    <!--书写位置:在head标签中的style标签内-->
    <!--css语法:css选择器 { 样式1; 样式2; } -->
    <!--优缺点: 可读性强,有复用性,样式被html页面绑定了,不能提供给其它html页面使用-->
    <style>
        h2 {
            color: red;
            font-size: 100px;
            text-align: center;
        }
    </style>

    <!--3、外联式-->
    <!--书写位置:在外部css文件中,在html文件中通过link标签引入css文件-->
    <!--css语法:css选择器 { 样式1; 样式2; } -->
    <!--优缺点: 可读性强,有复用性,适合团队开发(文件级别的复用性)-->
    <link rel="stylesheet" href="css/样式引入.css">
</head>
<body>
    <!--1、行间式-->
    <!--书写位置:在标签的style属性中书写样式-->
    <!--优缺点: 可读性差,没有复用性,书写直接-->
    <h1 style="color: red; font-size: 100px; text-align: center;">css的引入</h1>
    <h1>h1标签</h1>

    <h2>h2标签</h2>
    <h2>h2标签</h2>

    <h3>h3标签</h3>
    <h3>h3标签</h3>

    <h4>h4标签</h4>
    <h4>h4标签</h4>
</body>
</html>

External css file

/* css/样式引入.css */
h3 {
    color: green;
}
h4 {
    font-size: 50px;
    text-align: center;
}

Css directly introduced three kinds of priority

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>css的引入</title>\

    <!--优先级:
    1、内联与外联之间没有优先级区别,由于html属于解释性语言,书写在下方的会覆盖上方的样式
    2、行间式的优先级要高于一切
    -->

</head>
<body>
    <h3>h3标签</h3>
    <h3>h3标签</h3>

    <h4>h4标签</h4>
    <h4 style="font-size: 100px">h4标签</h4>
</body>

<style>
    h4 {
        color: #ff7800;
        font-size: 20px;
    }
</style>
<link rel="stylesheet" href="css/样式引入.css">
</html>

css foundation selector

Priority:! Important> between line> id> class> tag> the wildcard

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>css基础选择器</title>
    <style>
        /*优先级:可以从作用范围来判断 - 作用范围越精确,优先级越高 */
        /*1、统配选择器*/
        * {
            color: pink;
            font-size: 12px;
        }
        /*2、标签选择器*/
        h1 {
            font-size: 20px;
        }

        /*3、类选择器*/
        .h {
            font-size: 30px!important;
        }

        .h2 {
            font-size: 40px;
        }

        .h.h2 {
            font-size: 50px;
        }

        /*4、id选择器*/
        #hhh {
            font-size: 100px;
        }

        /*优先级:!important > 行间式 > id > class > 标签 > 统配 */
    </style>
</head>
<body>
    <h1 class="h">1标题</h1>
    <h2 id="hhh" class="h h2" style="font-size: 12px">2标题</h2>
</body>
</html>

Guess you like

Origin www.cnblogs.com/gaohuayan/p/11264983.html
Recommended