Second, supplement and review (HTML&CSS)

HTML (HyperText Markup Language) \

English: Hypertext Markup Language

Purpose: Defines the content and structure of a document

Development history:

Version 1.0 appeared in 1991;

Draft issued in 2008;

A stable version was formed in 2012;

** is a markup language

\

2) CSS (Cascading Style Sheets)

\

Cascading style sheets

Purpose: Defines the style of an HTML document

\

Development history:

Released in 1996;

It was revised to CSS2 in 1999

The CSS3 version in use is more modular.

** is a representation language

** Older versions are also called cascading style sheets

3) supplement

1. Browsers can read only three languages: HTML, CSS, and JS.

2. W3c is dedicated to defining Web rules and standards. Chinese official website: www.w3cschool.cn/

4) Changes to HTML5

1. The label:

1) DocType and meta are added;

2) Added semantic tags and attributes;

3) Remove the label of pure display;

4) Add Canvas, video, audio, local storage, drag and drop.

2. Grammar:

1) Tags are case-insensitive, but lower case is recommended;

2) Empty marks may not be closed;

3) Attribute values can be added without quotation marks.

4) Property values containing true and false can be omitted (used to control whether the property is in effect).

Document type definition DOCTYPE

\

Function: Prompts the browser to parse HTML or other formats next

Write it in the first row of your HTML file

\

<! DOCTYPE html>Copy the code

\

If they don’t, there’s a “weird pattern,” also known as promiscuous pattern; “Quirks Mode” is used when there is one,

\

Prepare the development environment

1. Install a browser (parsing code) such as Google, IE, Firefox, Safai Apple system built-in over the wall

2. Install the editor (edit code)

Seven) Four style sheets

1. External Stylesheets (outreach) :

Add a <link rel=”stylesheet “href =””> to the tag in the HTML to link the HTML to the CSS.

rel=relation

* If the two paths are in different locations (folders), they are written separately


2. Internal style sheet (inline) :

Use the style tag to write CSS styles in the tag:


<head>

<metacharset="UTF-8">

<metaname="viewport"content="width=device-width, initial-scale=1.0">

<metahttp-equiv="X-UA-Compatible"content="ie=edge">

<title>Document</title>

<style>

p{font-size:16px;color:black;}

<!-- 意思是下面文档中的所有的p元素的内容执行以上样式 -->

</style>

</head>



<body>

<p>008611</p>

</body>\

3. Inline style sheets (inline) :

Use the style attribute to write CSS in the start tag:

<body>

<pstyle="font-size: 25px;

color: rgb(221, 28, 28)">1008611</p>

</body>

4. Supplementary import stylesheets:

@import (import existing stylesheets from outside, with external links, rarely used)

***** The three stylesheets have precedence in order of execution: nearby (if all three are written) inline > inline > inline.

8) CSS reset (clear default style data)

Place the reset file under your CSS and make your CSS format the most important.

Associating in HTML (an HTML file can be associated with multiple CSS files)

<linkrel=”stylesheet”href=”reset.css”>

(The reset file is saved in the classroom exercises folder -reset)

9) Recommended websites:

Nuggets (colony of young programmed apes) juejin. Cn /

CSDN (old Java settlement) www.csdn.net/

Language finches www.yuque.com/

Blog garden www.cnblogs.com/

Rookie tutorial www.runoob.com/