DIV + CSS and divcss
DIV + CSSBytesDIV + CSS "is actually an inaccurate nameBefore taking notes, you must correct a mistake,It is actually an inaccurate method of calling "DIV + CSS ".It is the name given by Chinese people to this standard page layout method. It is caused by insufficient technical understanding. What is the standard name? Oh, that's right. The standard name isXHTML + CSS! Simply identify the previous page layout method from the code and the current popular page layout method, and think that the previous layout of the page uses Table, called"Table + CSS", But now layout the page, using DIV, so it is called"DIV + CSS". It sounds quite reasonable. I don't know if such a naming rule has misled most web developers and introduced them to two misunderstandings: [misunderstanding 1] If Table is used on a web page, the page is not standard, I even think that Table is a shame. Table is a key point to determine whether a page is standard. [Misunderstanding 2] The more DIV labels on a webpage, the better. Some people may even replace all the labels on the webpage with DIV, and the number of divs determines the page standard. To avoid mistakes, you must understand the purpose of the birth of the "Table" and "DIV" webpage elements. First, the purpose of Table creation is to store data, the purpose of DIV's birth is to set up the page structure. The two have different job functions. It is most convenient and convenient to use Table when data needs to be stored, for example, W3Cfun.com a theme page "browser Daquan", address is: http://www.w3cfuns.com/portal.php? Mod = topic & topicid = 6. At this time, it must be the most appropriate to use the Table, and the part of the page structure formed outside the Table is of course DIV, which is determined by the birth of the two of them, this page is a standard page that complies with W3C standards. However, DIV + CSS is deeply rooted in the hearts of the people. Especially for cainiao I just learned, DIV + CSS is more appropriate, anyway, I will also use DIV + CSS to explain it in the future. As for whether it will mislead you, you will be benevolent and wise, haha! I also want to comment: I guess it will be called section + css after html5 is popularized? Haha, what do you say?What is W3C standards?W3C standards are not a set of standards, but a set of standards. They contain three parts: Structure standards, performance standards, and action standards. The Representative language corresponding to the structure standard is xHTML, the representative language corresponding to the performance standard is CSS, and the Representative language corresponding to the action standard is JavaScript. Well, I have finished speaking about the common sense of the web Front-end. Now I am taking notes for today. By the way, it seems that I have no time to write a blog due to the winter vacation. Haha, you know.★Introduction to DIV + CSSIn the CSS layout mode, DIV is the core object of this layout mode, and our page layout is no longer dependent on tables. to make a simple layout, you only need two things: DIV and CSS. therefore, we call this layout method DIV + CSS layout.● DIV: Layout container labelsDiv is a container label specified in XHTML and used for layout design. Elements used to store html elements, text, images, and videos. The content style is specified by CSS.● CSS: stacked Style SheetsCSS (Cascading Style Sheet) is a standard method for formatting webpages. It is a technology used to control webpage styles and allow the separation of Style information from webpage content.★Advantages of DIV + CSS1. compliant with W3C standards. Microsoft and other companies are W3C supporters. 2. it provides more precise control over the layout, Font, color, background, and other graphic effects of webpages and makes adjustments more convenient. Currently, many websites use the DIV + CSS frame mode, it proves that DIV + CSS is the trend of the times. separating the format and structure facilitates format reuse and webpage modification and maintenance. In team development, division of labor and cooperation are easier and mutual relevance is reduced. the major advantages of CSS are the introduction code, which is smaller in size, faster in download, and saves a lot of bandwidth. As we all know, search engines like concise code. 5. With the CSS style sheet, you can direct all the webpages on the site to the same CSS file only, so that many webpages can be updated at the same time.★Apply CSSBasic syntax structure: Selector {property: property value;} example: p {color: red;}/* CSS comment mode */Introduction Method:[Inline]: Inside the HTML document, unmount the CSS code between the
[Inline style]: select the HTML tag you want to control and add the style attribute to it. Note that CSS is not required to be imported in this way.
[LINK style]: in actual website construction, link style CSS is the most commonly used with the best effect.<1> create a file suffixed with css. Write css in it. <2> Add the link tag to the
[Pilot type]: similar to the link type, the difference is that there is no need for syntax or usage.
<style><!--@import url(css/index.css);--></style>