2 front-end

Positioning layout:

Fixed positioning:

Reference is fixedly positioned within the browser window.

Relative to label a window is prohibited, fixed positioning

If there are a plurality of fixed positioning tags simultaneously and, but overlap may occur, this time need a z-index, which is the integer Who who large coverage.

 

Absolute positioning is a reference to locate the nearest parent pole labels

Absolute positioning:
1, as a label for a movement to move the parent (child After completion of the layout relative to the stationary position of the parent), and does not affect the label layout brothers (Brother movable, relative to their parent or still )
2, Z-index values change vertically overlapping relationship sibling layer
3, the parent of the child must be relatively positioning processing (positioning can be three kinds of)
the parent to the child first layout, the sub-stage absolute when positioning, the parent of the general layout has been completed, if the parent uses positioning to complete the layout, the natural child of the parent to complete the equivalent of absolute positioning
if the parent does not use targeting to complete the layout, we have to post-parented increase the positioning process, to assist the child absolute positioning, positioning is to increase the parent's late, we have to ensure that the increase does not affect the layout before parent, relative positioning can be done

Relative positioning:
1, relative to the parent child must

2, there is located opposite used independently, but the model can completely replace the cartridge, it is generally not

 

JavaScript

js: Front scripting language - programming language - a weak type of language - the business logic to complete the page and page interaction

1, you can generate your own page data
2, can request background data
3, can accept user data - can render to another location on the page; be submitted to the background
4, modify the page label content, style, properties, events (page can be done by js input and output devices to interact with the computer)

// a three output information
// console output statement
console.log ( 'Ah you so cool')

// pop-up message
alert ( 'Ah you really handsome')

// write content to the page
document.write ( '<h2 style = " color: red"> Ah you handsome dregs </ h2>')

// two, variable and constant
the let NUM = 123;
NUM ++;
the console.log (NUM);

STR = const '123';
// STR = '456'; // constants must be declared with an initial value, and, once assigned, unchangeable
console.log (str);

// Third, the data type
// value type
// 1) digital type
the let = 123 A;
the console.log (A, typeof (A));
A = 3.14;
the console.log (A, typeof (A));

// 2) boolean
the let B = to false;
the console.log (typeof (B), B);

// 3) String Type: '' "" ``
the let C = `123
456
789`;
the console.log (C, typeof (C));

// 4) undefined type: uninitialized variables of
the let D;
the console.log (D, typeof (D));

// reference type
// 5) array (corresponding List):
the let ARR = [. 1, 2,. 3];
the console.log (ARR, typeof (ARR));

// 6) the object (equivalent to dict): The key must be a string of all
let sex = 'M';
the let DIC = {
name: 'Owen',
Age: 17.5,
Sex, // if the value is a variable, the variable name key with the same name can be abbreviated
};
the console.log (DIC, typeof (DIC));

// 7) Function type
function Fn () {}
the console.log (Fn, typeof (Fn));

// 8) null type of
the let X = null;
the console.log (X, typeof (X));

// four weak language type
the let AAA = 123;
the let BBB = '123';

console.log (aaa == bbb); // == only data comparison
console.log (aaa === bbb); // === types for data comparison and

// weak language type: according to the environment on their own to decide how to select the type of data stored in
the console.log (. 1 + 2); //. 3
the console.log ( '. 1' + '2'); // 12 is
the console.log (. 1 + '2'); // 12 is
the console.log (. 1 - '2'); // -1

 

Guess you like

Origin www.cnblogs.com/xinfan1/p/11129624.html