The Web page foreground code often uses the Display:none style, usually found several characteristics need to notice
1, if in the style file or the page file code directly with the Display:none element is hidden, loading the page, in the absence of the JS set style to make the element display, the use of JS code will not be able to correctly obtain some of the element properties, such as offsettop, Offsetleft and so on, the returned value will be 0, the value can be obtained correctly after the element is displayed by JS setting style.display.
2, the use of display:none hidden elements will not be Baidu and other search site retrieval, will affect the site's SEO, in some cases can use left:-100000px to achieve the same effect.
3, if the style file or the <style>css</style> way to set the Display:none style of elements, with JS set style.display= "" does not make the element display, You can use block or inline equivalents instead. There is no problem with setting the style= "Display:none" directly on the element
4. In some cases, you can use style.visibility instead of style.display, but be aware that style.visibility hides elements while preserving the space occupied by the elements on the page, Style.display hides the elements and makes up the occupied page space.