9.24 CSS and JS relevant knowledge

CSS grouping and nesting:

<style type=”text/css”>

H1, h4, p {// packet

color:green;

}

</style>

 

.marked {} class = marked tags

.marked p {} for all class = "Marked" in the element p element specifies a pattern

p.marked {} as long as the p tag and class = "Marked" style will be changed

 

CSS display:

div {visibility: hidden;} In this manner remain its original features

div {display: none} This hidden labels directly, nor characterized

 

CSS positioning:

The Position : static (from top bottom left right affected) / relative (relative positioning element is positioned relative to its normal position) / Fixed (stationary) / adsolute (absolute position of an element positioned nearest positioned relative to the parent elements, if not already positioned parent element, the relative <HTML> ) / Sticky

CSS Align:

Align = left-Text : Center text is centered

Margin : Auto elements centered, center the image

JSjavascript

HTML (decide what page to display data) + CSS (decision Page Layout) + JS (or the server and user interaction, determine the behavior of the page)

 

JS : Halo front-end programming, scripting language, easy to learn, is based on HTML + CSS , marking tools: VSCode Sublime notepad browser helper debugging code

JS need to write in the <script> </ script> , the script can be placed in <head> or <body> Lane

Window.alert () playing block

Document.write () the contents written in HTML in

Console.log () writes browser-based console

Note: JS in case sensitive

Single-line comments: //

Multi-line comments: / * * /

JS data types

Digital 3.14 1001 123e3 = 123 * 10 ^ 3

String using single and double quotation marks

Array [1,3,4,5] array

Object { name: 'HQW', Age: 20 is }

When the definition data need to use the var keyword to define variables

Function function + fun function type + (parameter) + { function body } , wherein after line of code written, and needs; semicolon

Things to consider when defining variables:

1, the variable must begin with a letter, you use the $ or _ can be, but is not recommended

2, case sensitive

3, when the definition of variables, requires the use of var , the need to define a variable, the definition can be assigned at the time =

4, a statement can define a plurality of variable var name = 'icq', gae = 20, job = 'hacker'

5, no variable initialization, equivalent to undefined

 

JS data types

Value Type: String String / number numeric / boolean / NULL air / undefined undefined

Reference types: Object / Array / function

Var x undefined

Var = 123.12 Digital

Var po = "spring" statement

Var fo = ture boolean type

Var array_te=new Array();

Array_te[0]=”hellow”

Array_te[1]=”icq”

A=[“hellow”,”icq”]

 

Object:

Used to describe an abstract concept, people { properties, methods }

Var car={type:”BYD”,model:500,color:white,do:function(){“可以跑”}}

The use of property for the object:

Name=car.type;

Color=car[“color”];

For object methods of use:

Deal=car.do();

 

Defining and using functions:

No-argument function

Function fun()

{

Statement body;

}

 

There are function parameters

Function fun(a,b)

{

Body function ; // manifestation of a and b treatment

}

 

Function returns a value

Function fun(){

Return results

}

 

Robots.txt is generally robots protocol to prevent network search engines to crawl the site sensitive pages exist in the root directory of the site's robots.txt file, which is written clearly which pages are not allowed to crawling.

 

Variables: variable scope according to points

Local variables: variable declared inside a function, only to be used within the function

Global variables: variable declared outside a function, all the scripts and functions available on the web page to use him

String processing

String required '' or '' enclosed, may be used to access the subject embodiment each character string;

A string of special characters if you need to print out, you need to use the escape character \ , is to allow the escape character retains its original meaning, and not be treated as special characters to use

Use string.length get the length of the string, where the escape character \ is not length

Special characters: ' "\ \ R & lt \ T \ B backspace    \ f feed

String can be treated as an object, var = S new new String ( 'Test') is equivalent to S = 'Test'  ;

Properties: length (length), the prototype (added to allow the object properties and methods)

Methods: charAt () Returns the character at the specified position

index () Returns the character index

 

split () the string into an array of strings

 

substr (n) taken string, before the n characters removed

 

substring (a, b) intercept a and b-1 string between

 

toString () object is converted string

 

toLowerCase () turn lowercase   toUpperCase () turn uppercase

 

Use ngrok carried out within the network resource mapping

Step1 : Access https://www.ngrok.cc/user.html login, find the "Open Tunnel", tunnels and create open, download linux client, in

./sunny clientid + tunnel id

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/x98339/p/11579459.html