CSS practical tutorial

xiaoxiao2021-03-06  31

CSS practical tutorial (1)

CSS (Cascading Stylesheets, laminated style sheet) is a new technique for making web pages, and now it has been supported by most browsers, making it an essential tool for web design. Using CSS can simplify the format code of the web page, speed up the speed of downloading, and reduce the number of code required to upload, greatly reduces the workload of repetitive labor. Especially when you face a site with hundreds of web pages, CSS is simply like God for our gift! ^ _ ^ Foreword CSS (Cascading Stylesheets, laminated style sheet) is a new technique for making web pages, and now it has been supported by most browsers, making it an essential tool for web design. The W3C (The World Wide Web Consortium) divides dynamic html (Dynamic HTML) to implement: scripting language (including JavaScript, VBScript, etc.), supports dynamic browsers (including Internet Explorer, Netscape Navigator, etc.) and CSS Style sheet. One. The characteristics of the stacked style sheet do not say that the page is lacking in the field, which is also a lot of difficulties on the layout of web content. If it is not a professional or special patient, it is difficult to display information according to his own ideas and creativity. . Even if you have the essence of the HTML language, you have to test these information, the process is very long and painful. For the development of the Internet, let more people go soon, in this colorful world, the new HTML auxiliary tool wants to come out. The style sheet is born under this demand. It first is to do for the elements on the web, which can make the web designer like the director, easy to control the actors consisting of text, picture, on the web page The stage is taken well on the script. Second, it separates the content structure and format control on the web page. The viewer wants to see the content structure on the webpage, and in order to let the viewer better see this information, it is necessary to help it through the format control. The distribution of the two before the web page is interlaced, and the modification is very inconvenient, and now the two will be greatly convenient for the designer of the web page. The content structure and format control phase separation, so that the web page can be made by the content, and the format of all the web pages points to a CSS style sheet file. This way, good performance in two aspects: First, simplify the format code of the web page, the external style sheet will be saved in the browser, speed up the speed of downloading, and also reduce the code that needs to upload Quantity (because the format of repeated settings will be saved once). Second, just modify the CSS style table file saved to the website format, you can change the style of the entire site, which is very useful when modifying the number of sites in the number of pages. Avoid a modification of a web page, greatly reduces the workload of duplicate labor, when you face the site with hundreds of web pages, CSS is simply like God to our gift! ^ _ ^ 2. How to add a stacked style sheet We have four methods for adding a style sheet for web pages. 1. The easiest way is to add directly to the Identifier (TAG) of HTML: page content give an example:

CSS instance code description: Use blue display of "CSS instance" with a font size.

Although it is easy to use, it shows intuitive, but this method is not very common, because this is added to the advantage that the style sheet cannot be fully placed "content structure and format control separately save". 2. Added in HTML header information identifier :