页面布局

1、Avoid div-itis
The danger when using div and span elements is in going overboard.
A few of them placed in strategic spots can greatly enhance the inherent structure of a document;
too many, and you may wish to question whether there's a more appropriate HTML element you should be using.
For example, a div should never be used where an h3 would make more sense, and a span should never replace a label.

But that doesn't mean they should be avoided. A few divs in logical spots throughout your document will provide extra styling control and logical separation of sections. Think of a div as a reusable container: You don't want to bury your content in too many containers, but a few well-placed divs can keep content sorted well.

You can apply both a class and an id to a single element, but remember that using more than one instance of the same id within a page is invalid. Alphanumeric characters (a-z, A-Z, 0-9) can be used in both class and id names, but neither may start with a number. And even though some browsers are forgiving, it's wise to consider both case-sensitive, for ease of debugging.

2、innerHeight() 把padding算上去
outHeight() 把border也算上







你可能感兴趣的:(html)