Before the understanding of the CSS is not much, their usual writing is also basically dependent on bootstrap, basically did not have their own to design the UI, in this project experience, stepped on some big pits, of course, to the novice have these puzzles, recorded here, to facilitate their own after inspection, and share it with more new people in the pits.
Of course, before you start, you have to spit out the biggest pit in the front--ie!
Clear Formatting
Before you write CSS, if your page does not introduce other styles, be sure to first level to "clear style", where the clear style, mainly refers to clear the browser's two default style (padding and margin), otherwise, your forehead will also appear in the background of the white edge of the abnormal situation.
{ margin: 0px; padding: 0px; }
Background position
When you go to set the background, be sure to pay attention to the scope of the background, the Background-clip attribute specifies the drawing area of the background, the Background-origin attribute specifies where the background-position attribute is positioned relative to.
Background-clip:border-box | Padding-box | Content-box;background-origin:padding-box | Border-box | Content-box;