Daily Reflections (2020/01/15)

Topic Overview

  • DOM and BOM What is the difference?
  • Allows web font becomes clear, thinning with CSS how to do?
  • A method to write a conversion between 0 and 1 (0 is set to 0 is set 1,1)

Subject to answer

DOM and BOM What is the difference?

  • DOM Document Object Model is an abbreviation of. That document object model, follow the standard developed by W3C. It provides independent and objects to interact with the content in the browser window. Describes a method and an interface to interact with the browser, you can access and manipulate the browser window, for example, can pop up a new window, change the text in the status bar. Its essence is the DOM element. The earliest use of document.getElementByIdthe acquired object is a DOM object. JS DOM operation using a color, shape, size of the DOM elements are operating. On the code may be understood as documentthe beginning of the methods and properties
  • BOM is an abbreviation of the Browser Object Model. That browser object model, which does not have a required standard, each browser has its own implementation for the DOM is a tree-based API HTML is. A method and interface processing web content, is the HTML API, DOM into planning the entire page document consisting of a node level. But in fact in most of the major features have formed a tacit understanding. BOM major operating behavior of the browser, than navigator, location, history, storageboth for the operation of the BOM. Which is the root object window, it may be understood as a method beginning winodw
  • Relationship: DOM in the BOM, the only JS host environment is the browser DOM and BOM only when, in the Node is no two objects

Allows web font becomes clear, thinning with CSS how to do?

  • font-weight + font-family: font-weightto control the thickness of the corresponding still need to see there is no corresponding font variants font. So this and font-familyrelated.

  • -webkit-font-smoothing: This property is Chrome's anti-aliasing properties. It will appear after adding carefully, but effective only for webkit browser kernel

    -webkit-font-smoothing: antialiased
    -moz-osx-font-smoothing: grayscale
    text-shadow: 1px 1px 1px 1px rgba(0,0,0,0.005)
    text-rendering: optimizeLegibility

A method to write a conversion between 0 and 1 (0 is set to 0 is set 1,1)

//方法一
const reverse = x => +!x
//方法二
const convert = num => num ^ 1;
//方法三
const reverse = x => ~x+2

Guess you like

Origin www.cnblogs.com/EricZLin/p/12199325.html