Website update: www.dadaqianduan.cn/#/%E5%89%8D…

Web page creation basics

Note: As a learning aid only

So what can Web page creation basics teach you?

Section 1: Mastering Web basics.

Section two: Basic knowledge of HTML.

Section 3 Basic knowledge of the CSS.

Web Development Background

  1. The concept of computer language
  2. Interpretation and compilation
  3. The introduction of Sublime does
  4. Introduction to Developer Tools
  5. Naming conventions

Naming conventions

  • The English name
  • Numbers should not start
  • Hump nomenclature

Learn front-end contact with web basic languages, HTML, CSS, JavaScript

Web Basics

Read for 15 minutes each time:

  1. InternetInternet Internet in Chinese.
  2. It is a global network of computers that communicate with each other in a common language.
  3. WWWisWorld Wide WebThe Abbreviation of the Chinese name world Wide Web.
  4. WWWisInternetThe most important part of.
  5. It is aInternetOn those who supportWWWServices andHTTPA collection of servers for the protocol.
  6. WWWIn use is divided intoWebThe client andWebThe service side.
  7. Users can useWebClient accessWebPages on the server.
  8. Website, the Chinese name for website, refers to inInternetOn according to certain rules, useHTMLA collection of related web pages created to display specific content.
  9. URL, it isUniform Resource LocatorThe abbreviation, The Chinese name is unified resource locator, commonly known as the website, it is a concise expression of the location and access method of resources that can be obtained from the Internet, is the address of the standard resources on the Internet.

General format of URL:

Protocol :// Host IP address + directory path + ParametersCopy the code

Common protocols are:

A. FTP: File Transfer Protocol. You can access files on the server through FTP. Generally, the host address is preceded by username: password @.

Example:

Url: ftp://admin:[email protected]/html.pdfCopy the code

B. file: mainly accesses files on the local computer.

C. Telent: Allows users to communicate with a remote device through a negotiation process.

HTTP: Hyper Text Transfer Protocol HTTP: Hyper Text Transfer Protocol HTTP: Hyper Text Transfer Protocol

  1. Web Standard(WebStandard) isWebStandards that application development needs to adhere to.
  2. Web page mainly consists of three parts: structure standard, performance standard, behavior standard.

Website Access Process

Url Uniform resource locator

The addresses of standard resources on the Internet, the locations and access methods of resources available on the Internet.

Components: protocol, server address, resource path.

  1. Web BrowserWeb browser, in Chinese, is a software that displays HTML files in a web server or archive system and lets users interact with these files.
  2. Web Server, web server in Chinese,WEBServer, mainly to provide online information browsing services.

The Web server can parse THE HTTP protocol. When the Web server receives an HTTP request, it returns an HTTP response. The client can obtain the HTML, including CSS, JS, video, and audio, from the server.

  1. webDevelopment is mainly divided into front-end and back-end two parts.
  2. The front end is the web page that is directly in contact with the userhtml,js,cssAnd so on.
  3. The back-end refers to the application, database, and server levels

Web system development process

Project proposal, requirement analysis, (design, UI design, system design), (development, front-end development, background development), system testing, development and maintenance.

HTML Basics

  1. History of HTML: HTML, XHTML
  2. HTML global properties: global standard properties, global event properties
  3. HTML elements:

  1. Markup language is a type of computer coding that combines text and other text-related information to reveal details about document structure and data processing.
  2. HTML, for hypertext markup language.
  3. XHTMLIs extensible hypertext Markup language, is a purer, stricter, more normativehtmlThe code.
  4. htmlA file consists of a header and a body.
  5. Label classification: double label, single label.

Double label: Consists of start label and end label. It must be used in pairs and properly nested.

Single tag: Close the start tag (end at the end of the start tag).

HTML global standard attributes

In HTML, eight global standard attributes are specified.

  1. classThe name of the class used to define the element.
  2. idUsed to specify the uniqueness of the elementid.
  3. styleUsed to specify the inline style of the element.
  4. titleAdditional information for specifying elements.
  5. accesskeyUse to specify the shortcut key for activating an element.

Elements that support the accesskey attribute are ,

,

  1. tabindexUsed to specify the element intabThe order of the keys.

,

,

  1. dirUsed to specify the text direction of the content in the element.

There are only LTR and RTL values for dir, which are left to right and right to left respectively.

  1. langThe language used to specify the content of the element.

HTML global event properties

WindowWindow events

  1. onloadIs triggered after the page has finished loading.
  2. onunloadTriggered when the user leaves the page, such as clicking to jump, reloading the page, closing the browser window, etc.

FormForm events

  1. onblurEmitted when an element loses focus.
  2. onchangeEmitted when the element’s element value is changed.
  3. onfocusEmitted when the element gains focus.
  4. onresetTriggered when the reload button in the form is clicked.
  5. onselectEmitted when the element text is selected.
  6. onsubmitTriggered when the form is submitted.

KeyboardKeyboard events

  1. onkeydownTriggered when the user presses a key.
  2. onkeypress, triggered when the user presses the key.

This property does not apply to all keys, such as Alt, CTRL, Shift, and ESC.

  1. onkeyupTriggered when the user releases the key.

MouseMouse events

  1. onclickTriggered when the mouse is clicked on the element.
  2. ondblclickTriggered when you double-click on an element.
  3. onmousedownTriggered when the mouse button is pressed on the element.
  4. onmousemoveEvent occurs when the mouse pointer moves.
  5. onmouseoutTriggered when the mouse pointer moves out of the element.
  6. onmouseoverEvent occurs when the mouse pointer moves over the specified element.
  7. onmouseupTriggered when the mouse button is released on the element.

Media Events

  1. onabortTriggered when exiting the media player.
  2. onwaitingTriggered when the media has stopped playing but intends to continue playing.

The HTML element

The tags contained in an HTML document

  1. <! DOCTYPE>Declare the document type.
  2. <html>, the true root of the HTML element.
  3. <head>To definehtmlThe document header of the document.
The element contained in the head, title, defines the title base of the HTML document, specifies the default address or default target link for all links on the page, defines the relationship between the document and external resources, meta, provides metadata style about the HTML, Used to define style information scripts for HTML documents, used to define client-side scriptsCopy the code
  1. bodyTo definehtmlThe body of a document.
  2. content-Type, which is used to set the character set of a web page to facilitate the browser to parse and render the page.

Code:

<meta http-equiv="content-Type` content="text/html"; charset=utf-8">
Copy the code
  1. cache-control, which tells the browser how to cache a response and for how long.

Parameters:

No-cache: sends a request to the server to confirm whether the resource has been changed. If not, use the cache no-store to allow caching. Download the complete response from the server each time. <meta http-equiv=cache-control" content="no-cache">Copy the code
  1. expires, which is used to set the expiration time of the web page. After the expiration time, the web page is re-transmitted to the server.
  2. refresh, the page will automatically refresh and redirect to the specified url within the specified time
  3. Set-CookieTo set the expiration of a web page.
  4. Non-semantic elements:<span>,<div>.<span>Inline tag, used in a line of text,<div>It is a block-level label.

DIV+CSS

Div is used to store the data to be displayed, and CSS is used to specify how to display the data style, separating structure from style.

View div+ CSS style HTML: Click the link below to jump, you can view the source code:

div-css.html

Formatting element

  1. Plain text
  • <b>, define bold text
  • <big>, define large words
  • <em>Definition focuses on words
  • <i>, define italics
  • <small>, define small words
  • <strong>, define the emphatic mood
  • <sub>, define the subscript
  • <sup>, define superscript words
  • <ins>, define the insert word
  • <del>, define the delete word
  1. Computer output
  • <code>Define the computer code
  • <kbd>To define the keyboard output style
  • <samp>, define computer code samples
  • <tt>To define typewriter input styles
  • <pre>, define preformatted text
  1. The term
  • <abbr>, define abbreviations
  • <acronym>, define acronyms
  • <address>, define address
  • <bdo>, define text direction
  • <blockquote>Defining long references
  • <q>Define short quotations
  • <cite>, define quote, quote
  • <dfn>Define a concept, project

Image element

<img SRC =" image url" Alt =" image substitute text ">Copy the code

Hyperlinked element

  1. <a>Of the labeltargetProperty, the default value is_self.
value instructions
_self Open the target page in the frame or window of the hyperlink
_blank Open the target page in a new browser window
_parent Load the target page into the parent frameset or parent window that contains the link frame
_top The target page opens in the current entire browser window, so all frames are removed
  1. Text links are<a></a>The element content between the tags is the text content.
  2. Anchor point links are used#+ corresponding anchor point, anchor points usually have unique attribute valuesidSetting.

Image hotspots link

Image hotspot links, what are they? When you look at some shopping web pages, a picture, you can link to different target locations in different places, click on different places to jump to different web pages, which is generally used to do mall projects.

Instead of a tag element, this is a

element.

The

element has two shape, records properties.

shapeattribute instructions cordsattribute instructions
circle circular x,y,r (x,y) is the center coordinate, and r is the radius
rect rectangular x1,y1; x2,y2 (x1,y1) is the upper-left coordinate, and (x2,y2) is the lower-right coordinate
poly polygon x1,y1; x2,y2; x3,y3; . These are the coordinates of each point

coordinate system, the origin is the upper left corner of the image, X-axis positive direction to the right, Y-axis positive direction downward

The use of image hotlinks. The

tag defines an image-map that can contain more than one hotlinks

, each with independent links.

The

tag is assigned the name attribute.

Associate the USEMAP attribute of the < IMG > tag with the name attribute of the

tag.

To prove that I’ve learned, LET me write an HTML page.

map -> name="image_link"

img -> usemap="#image_link"
Copy the code

Click to jump to: imgmap.html

E-mail link

Email links are mainly to see a lot of official web pages need to do one to open a new email.

Click the link below to see the effect:

Contact us

Code:

<a href="mailto:[email protected]">Copy the code

Javascript links

Click on the JavaScript link:

Click the popup window

Code:

<a href="javascript:alert(' Ha ha, you clicked! ');" > Click popover </a>Copy the code

Null links

  1. An empty link is a hyperlink that has no target address assigned.

Empty link code:

javascript: void(0)

<a href=""></a>

<a href="#"></a>

<a href="javascript:void(0)"></a>
Copy the code

List elements

To integrate a list of HTML pages, click to jump to: ul-ol.html

  1. Unordered list,<ul>Define an unordered list,<li>Define list items.
    type attribute values: disc point, square square, circle, None None.
  1. Ordered list,<ol>Define an ordered list,<li>Define list items.

< OL > Type attribute values: numbers, uppercase letters, uppercase Roman numerals, lowercase letters, lowercase Roman numerals.

The start attribute defines the start position of the sequence number.

  1. Define a list<dl>Defines that a list can have multiple list item headings inside the list<dt>Tag definition, list item title inside can have multiple list item description, with<dd>Tag definition.

form

To integrate tabular HTML pages, click to jump to: table.html

  1. <table>Define the form
  2. <caption>Defining table titles
  3. <tr>Define several lines
  4. <td>Define several cells
  5. <th>Define the header
  6. Table divided into head, body and bottom:<thead>,<tbody>,<tfoot>Three tags.
attribute instructions
border Sets the border width of the table
width Set the table width
height Set the height of the table
cellpadding Set the inside margin
cellspacing Set margins
  1. <td>Two properties of:colspanUsed to define cell rows,rowspanUsed to define cell span columns
  2. <tbody>,<thead>,<tfoot>Tags are often used to group table contents.
  3. The form of<form>Tag definition,actionProperty defines the address at which the form is submitted,methodProperty defines how the form is submitted.

Code:

<input type="text">

<input type="password">

<input type="radio">

<input type="checkbox">

<input type="submit">

<input type="reset">

<input type="button">

<input type="image">

<input type="file">

<input type="hidden">
Copy the code
The <select> <option> size attribute is used to set the height of the selection bar, and the multiple attribute is used to determine whether the list is selected or selected="selected".Copy the code

Form control for entering more text

The < textarea > element

The

  1. nameFor submitting parameters
  2. valueUsed to enter text content
  3. colsandrowsFor the number of columns and lines, width and height of the text box respectively.

Effect:






Code:

<form action="web" method="post"> <br/> <textarea rows="10" cols="50" name="introduce"> </textarea> <br/> <input type="submit" id="" name=""> </form>Copy the code

frameset

  1. <frameset>Defines a frameset for organizing multiple Windows, with each frame holding a separate HTML document
  2. <frameset>Can’t with<body>Common use, unless available<noframe>The element
  3. <frame>Used to define<frameset>A specific window in. Empty elements<frame/>

Frame properties

attribute instructions
src DisplayablehtmlThe document
frameborder Defines the outer border of the frame with an attribute value of 0 or 1
scrolling Defines whether to display a scroll bar, with three values: yes,no,auto
noresize="noresize" Definition The frame cannot be resized. it is resizable by default
marginheightandmarginwidthattribute Define the top, bottom, left, and right margins
  1. <noframe>For displaying text for browsers that do not support framesets
  2. <iframe>, and<frame>The elements are the same,iframeThere areframeProperty, and also addedheightandwidth

Code:

<! DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>frameset</title> </head> <frameset cols="25%,50%,25%"> <frame src="https://blog.csdn.net/qq_36232611" scrolling="no" noresize="noresize"></frame> <frame src="https://juejin.cn/user/1451011081249175" ></frame> <frame src="https://www.jianshu.com/u/c785ece603d1" ></frame> </frameset> <noframes> <body> Your browser cannot handle frames, please change your browser to open </body> </noframes> </ HTML >Copy the code

The reserved character

Reserved characters in HTML must be replaced with character entities.

According to the results describe The entity name The entity number
The blank space &nbsp; The & # 160;
< Less than no. &lt; & # 60;
> More than no. &gt; The & # 62;
& And no. &amp; & # 38;
quotes &quot; & # 34;
apostrophe &apos;(IE not supported) & # 39;
Point (cent) &cent; The & # 162;
£ The pound (pound) &pound; The & # 163;
selections Yuan (yen) &yen; The & # 165;
euro The Euro &euro; The & # 8364;
§ section &sect; The & # 167;
© Copyright (Copyright) &copy; The & # 169;
® The registered trademark &reg; The & # 174;
The trademark &trade; The & # 8482;
x Multiplication sign &times; The & # 215;
present devide &divide; The & # 247;

CSS Basics

  1. cssIn English,Cascading Style SheetsCascading style sheets. Cascading style sheets.
  2. cssIs a presentation language, is a supplement to the web language.
  3. cssStyle design for web pages, including font, color, location, etc.
  4. cssThere are 4 ways to use: Import external style files, import external style files, use internal style definitions, and use inline style definitions.

Import external style files:

<link type="text/ CSS "rel="stylesheet" href=" CSS style file URL "/>Copy the code

Import an external style file:

<style type="text/ CSS "> @import "CSS style file url"; </style>Copy the code

Using internal style definitions:

<style type="text/css">
 div {
     background-color: #ffffff;
     width: 300px;
     height: 300px;
 }
</style>
Copy the code

Use inline style definitions:

<div style="background-color: #ffffff; width: 100px; height: 100px;" > </div>Copy the code

CSS has two features: cascading and inheritance

Cascade: priority for cascading styles to work:

Inline Style -> Internal Style -> External Style -> Browser Default.

Inheritance means that CSS properties can be passed down from parent elements to child elements.

cssThe selector

  1. Element selectors are the simplest selectors.
  2. Wildcard selector, with"*"Representation, representation is valid for any element.
  3. Property selector

Format:

E[attribute]{property1:value1; property2:value2;...}
Copy the code
grammar instructions
E[attribute] Use to select an element with the specified attribute
E[attribute=value] Use to select an element with the specified attribute and the specified value
E[attribute~=value] Use to select an element whose attribute value contains the specified value, which must be a full word, possibly preceded by a space
E[attribute|=value] Use to select an element with an attribute value that begins with the specified value, which must be the entire word or be followed by a hyphen “-“

Derived selector

  1. Derivation selectors define styles based on the context of the element at its location

  2. There are three types of derived selectors: descendant selectors, child element selectors, and adjacent sibling selectors

  3. Descendant selectors are all the elements that are descendants of an element.

  4. A child selector is the first child of a condition relative to the parent.

  5. The adjacent sibling selector is for sibling elements that have the same parent and are adjacent to each other.

  6. Id selector that specifies the style as an HTML element with a specific ID value.

  7. Class selector that specifies the style of the HTML element that specifies the class.

  8. Pseudo class selector

Pseudo-class selectors: pseudo-class selectors and pseudo-element selectors

Pseudo-classes begin with a colon (:), cannot have Spaces between the element selector and the colon, and cannot have Spaces between pseudo-class names.

The following table lists common pseudo classes in the CSS:

Pseudo class name instructions
:active Add styles to the activated elements
:focus Add styles to elements that have input focus
:hover Add styles to the elements over which you hover
:link Add styles to links that are not accessed
:visited Adds styles to links that have been accessed
:first-child Adds a style to an element that is the first child of its parent
:lang Direction band designationlangAttribute to the element add style

Pseudo element selector

The following table lists common pseudo-elements in the CSS:

Pseudo element name instructions
:first-letter Adds styles to the first letter of the text
:first-line Add styles to the first line of text
:after Add content after the element
:before Add content before the element

The CSS background

The CSS background attributes are as follows:

attribute instructions
background-color Define the background color
background-image Define background image
background-repeat Defines whether and how the background image is repeated
background-attachment Defines whether the background image scrolls with the content
background-position Define the horizontal and vertical positions of the background image
background You can define various background properties with a single style

background

  1. background-colorUsed to set the background color, starting withtransparentTransparent color.
  2. The color can be a hexadecimal color, or an RGB function.
  3. background-imageThe background image used to set the element. The default isnone.
  4. background-repeatControls the tiling of images.

The default background-repeat value is repeat, that is, the image is tiled along the X and y axes. You can also specify tiling rpeat-x along the X axis, repeat-y along the y axis, or no tiling no-repeat, inherit from the parent element.

  1. background-attachmentUsed to set whether the background image is fixed or scrolls along the rest of the page. The default value is:scroll, indicating that you can scroll along with the rest of the page. Set up thefixed“, the background image does not scroll while the rest of the page scrollsinheritInherits the parent element.
  2. background-positionUsed to set the position of the background image dot.

Background can set background-color, background-position, background-attachment, background-repeat and background-image.

CSS Font Properties

CSS common font property table:

attribute instructions
font-family Defines the font family for text
font-size Defines the font size of the text
font-variant Defines whether to display text in a small capital font
font-style Defines whether the font of text is italic
font-weight Define the size of the font
font You can define various font properties in a single style
  1. font-familyUsed to set the font of an element. This element attribute value can typically set multiple fonts.
  2. font-sizeUsed to set the font size.
  3. font-styleUsed to set whether the font is italic. The default value isnormalWhen set toitalicDisplay as an italic style when set tooblique, displayed as a slanted style.
  4. font-variantUse to set the font to lowercase. DefaultnormalOnce set tosmall-caps, changes all lowercase letters to uppercase.
  5. font-weightUsed to set the thickness of the font,normalThe value is equal to 400,boldThe value of theta is equal to 700.
  6. font, you can setfont-family,font-size,font-style,font-variant,font-weight.

CSS text property table:

attribute instructions
color Text color
direction Text direction or writing direction
letter-spacing Character spacing
line-height Line height of text
text-align The horizontal alignment property of the text sets the horizontal alignment of the text of the elementLeft, Right, Center, Inherit.
text-decoration Adds a modifier effect to the textUnderline underline, overline underline, line-through underline, blink underline,none inherit.
text-indent Defines how to indent the first line of text. The default value is 0
text-shadow Adds a shadow effect to the text
text-transform Toggles the case of text
white-space How do you handle whitespace inside an element
word-spacing Define the distance between words

CSS size property table:

attribute instructions
width Sets the width of the element
min-width Sets the minimum width of the element
max-width Sets the maximum width of the element
height Sets the height of the element
min-height Sets the minimum height of the element
max-height Sets the maximum height of the element

CSS list property table:

attribute instructions
list-style-image Set the list item tag style to image,none/inherit/url
list-style-position Set the position of the list item marker,inside/outside/inherit
list-style-type Sets the type of list item tags
list-style You can define various list properties with a single style

list-style-type

value instructions
disc Solid round
circle The hollow circle
square square
decimal digital
low-roman Lower Roman numerals
upper-roman Capital Roman numeral
low-alpha Lowercase letters
upper-alpha The capital letters
none No mark
inherit Inherits this setting from the parent element

CSS table property table:

attribute instructions
border-collapse Sets whether to merge table borders
border-spacing Sets the distance between adjacent cell borders
caption-side Sets the position of the table title
empty-cells Sets whether to display borders and backgrounds on hollow cells in the table
table-layout Sets how to set the column width of a table cell

The box model

  1. cssA box model that contains element contentcontentThe paddingpadding, borderborderAnd externalmargin.

CSS margin property, the inside margin of an element is between the border and the content.

CSS inner margin properties:

attribute instructions
padding-top The upper inner margin of the element
padding-right The right inner margin of the element
padding-bottom The lower inner margin of the element
padding-left The left inner margin of the element
padding Define all margin attributes with a single declaration

The setting sequence is top, right, bottom, left.

padding: 10px 10px 10px 10px;
Copy the code

CSS margin properties:

attribute instructions
margin-top Defines the upper margin of an element
margin-right Defines the right margin of the element
margin-bottom Defines the lower margin of the element
margin-left Defines the left margin of the element
margin Define all margin attributes with a single declaration

CSS border properties:

attribute instructions
border-top-style The style property of the top border
border-right-style Style property for the right border
border-bottom-style The style property of the bottom border
border-left-style Style property for the left border
border-style Sets the style properties for the four borders
border-top-width Sets the width property of the top border
border-right-width Sets the width property for the right border
border-bottom-width Sets the width property of the bottom border
border-left-width Sets the width property of the bottom border
border-width Sets the width property for the four borders
border-top-color Sets the color property for the top border
border-right-color Sets the color property for the right border
border-bottom-color Sets the color property of the bottom border
border-left-color Sets the color property for the left border
border-color Sets the color properties of the four borders
border-top Define all top border attributes with a single declaration
border-right Define all right border properties with a single declaration
border-bottom Define all attributes of the bottom borders with a single declaration
border-left Define all attributes of the left border with a single declaration
border Define attributes for all borders with a single declaration
border-width Define the width of 4 borders at a time
border-color Define 4 border colors at a time

Border style

  1. none, no border effect
  2. hidden, andnoneThe same
  3. dotted, dot line border effect
  4. dashed, dashed border effect
  5. doubleDouble line border effect
  6. solidSolid border effect
  7. groove, 3D groove border effect
  8. ridge, 3D convex groove border effect

A CSS outline is a line drawn around an element, around the edge of the border, to highlight the element.

attribute instructions
outline-style Defines the style properties of the contour
outline-color Defines the color properties of the contour
outline-width Defines the width property of the contour
outline Define all contour attributes in the same declaration

The layout properties

  1. Layout attributes are rules for arranging and displaying elements in a document
  2. There are three layout modes: normal document flow, float, and Position

Properties involved in CSS floating

attribute instructions
float Set whether the box needs to float and in which direction
clear Sets the side of the element on which other floating elements are not allowed
clip Clipping absolute positioning element, the element must be absolute positioning, top right, bottom left principle
overflow Set the handling of content overflow element boxes, value:visible,auto,hidden,scroll
display How does the element display its valuenone,block,inline,inline-block,inherit
visibility Defines whether the element is visible,visibilityIf set to hidden, the space occupied by the element remains, butdisplay:noneNo reserved occupied space, value:visible,hidden

Attributes of the CSS location

attribute instructions
position Element location type, valuestatic.absoluteAbsolutely,relativeThe relative
top Margin on the element
right Element right margin
bottom Element lower margin
left The left margin of the element
z-index The stack order of elements

Z-index sets the location hierarchy of the target object. A larger value indicates a higher level. This property is valid only if position: Absolute.

❤️ thank you

1. If this article is helpful to you, please support it with a like. Your like is the motivation for my writing.

2. Add wechat [Xiaoda0423] and pull you into the technical exchange group to study together.