1. background: url(http://i.imgur.com/b9r5sEL.jpg) bottom center;
    2. background-size: [ <length> | <percentage> | auto ]{1,2} | cover | contain;
    1. justify-content:!flex-start | flex-end | center | space-between | space-around

    应用于父级元素
    image.png

    1. align-itemsflex-start | flex-end | center | baseline | ! stretch

    a b c padding 不一样 应用于父级元素
    image.png

    1. text-align:! start | end | left | right | center | justify | match-parent | justify-all
    2. /* 适用于: 块容器 */

    image.png


    1. function playSound(e) {<br /> const audio = document.querySelector(`audio[data-key="${e.keyCode}"]`)<br /> const key = document.querySelector(`div[data-key="${e.keyCode}"]`)<br /> if (!audio) return;<br /> key.classList.add('playing');<br /> audio.currentTime = 0;<br /> audio.play()<br /> }

    function removeTransition(e) {
    if (e.propertyName !== ‘transform’) return;
    e.target.classList.remove(‘playing’);
    }

    //这里顺序是重要的!!
    const keys = Array.from(document.querySelectorAll(‘.key’));
    keys.forEach((key) => {key.addEventListener(‘transitionend’, removeTransition)});window.addEventListener(‘keydown’, playSound)


    1. // parsing:
    2. parseInt("20px"); // 20
    3. parseInt("10100", 2); // 20
    4. parseInt("2e1"); // 2
    5. // type conversion
    6. Number("20px"); // NaN
    7. Number("2e1"); // 20, exponential notation
    1. console.log(Math.sign(3));
    2. // expected output: 1
    3. console.log(Math.sign(-3));
    4. // expected output: -1
    5. console.log(Math.sign(0));
    6. // expected output: 0
    7. console.log(Math.sign('-3'));
    8. // expected output: -1
    1. function maxChar(str) {
    2. const charMap = {};
    3. for (let char of str) {
    4. charMap[char] = charMap[char] + 1 || 1;
    5. }
    6. return charMap;
    7. }