Body {font-family: Arial, sans-serif; color: #333333; line-Height: 1.166; margin: 0px; padding: 0px ;}# masthead {margin: 0; padding: 10px 0px; border-bottom: 1px solid # cccccc; width: 100% ;}. feature IMG {float: Left; padding: 0px 10px 0px 0px; margin: 0 5px 5px 0 ;}
# Corresponding ID. corresponding class without corresponding HTML Tag 1. Difference between class and ID
A class is used to define one or more elements according to user-defined standards. For example, a script: A class can define the story line of each character in the script. You can use this class through CSS and JavaScript. Therefore, you can use class = "Frodo", class = "gandalf", class = "Aragorn" on a page to differentiate different story lines. Another important thing is that you can use any number of classes in a document. ID is usually used to define a tag that appears only once on the page. In structured layout of page layout (for example, a page is usually composed of a header, a header, a content area, and a footer), the ID is generally ideal, because an ID can only be used once in a document. These elements are rarely larger than once on the same page. In one sentence, the class can be used repeatedly, and the ID can only be used once on a page. It is possible that the same ID will not be used repeatedly in many browsers, but it is definitely incorrect in terms of standards, and it may lead to practical problems in some browsers. In practical application, the class may be useful for text layout, and the ID is useful for macro layout and design of various elements. 2. the difference between margin and padding is to replace the most important function of a table-> A good way to split blocks, the difference is that margin is the distance between different tags, while padding is used for separation of different content in the same element, which is the most clear in the table. Especially when the background style is loaded for a region, the background color of the content under the padding changes, while the margin does not.