Web Design
Mobile Internet
Brand Design
Innovative
News
Encyclopedias

How to play the role of CSS 2.0

Date:2015-07-29 Source: Shangpin China Type: website encyclopedia
Word Size: small   medium   big

The application of css is the focus of this article and an important part of the transition to Web standards. Compared with the structural design, the style design of the presentation layer is richer and more difficult to master. For the ever-changing web page design, how to code the design into a style language that can be recognized by the machine is also the focus of CSS. The rich style expression of Css also puts forward higher requirements for designers. In view of the requirements for the transition to Web standards, here are some suggestions and requirements for the writing of CSS, which will be discussed in detail in later chapters.

1. Reasonable CSS file structure
Although CSS achieves the separation of style design and content, the CSS file itself should also have a good hierarchy and specification, in order to further replace the maintainability of style design. CSS itself supports the Import function, which is aimed at large Website Design You can use separate CSS files to organize styles. For example, font styles are specially written in the font.css file, and form designs are placed in the form.css file. By reasonably organizing these files, it can bring convenience for later maintenance, and also facilitate the website program to call files according to the browser version or terminal device, further improving the cross platform response capability of CSs.

2. Advantages of inheritance and reuse
The advantage of using CSs is its good reusability. A piece of CSs design code can be used by multiple areas at the same time. In addition to the tortoise function, CSs can also implement an inheritance mechanism similar to that in object-oriented programming, which can further improve the style structure of websites. For example, in the XHTML corresponding to CSs, the insulting tags always use their own tag style design first, and then use the parent tag style, so that part of the code can be placed in each level separately, and they play a role in each other; The unified code is placed in the top label. By using this function with inheritance mechanism, we can further reduce the amount of code in style design and further improve the design method.

3. Design cross platform code
CSS also has its drawbacks. Due to the different ways of rendering between browsers of different brands and different versions, there are also some differences in the interpretation of CSS by different browsers. Some old versions of browsers (such as IE4.0 and IE5.0) are still used by many users who do not want to upgrade. In addition, the browser products under PC F and MAC are ignored. For these reasons, CSS design should also have certain cross platform compatibility features, and the use of obscure attributes should be minimized when coding. If you want to be compatible with older versions of browsers, you should also pay attention to leaving some CSS hack code.

4. Css style design with good usability
With the development of human-computer interaction technology, usability expands its content and form. The goal of usability is to make our interactive products (software, website) meet the needs of users to the maximum extent, so that the products can be more easily used by users. It fundamentally changes the subjective process of interaction between users and products, improves the value of products, and brings benefits to both products and users. CSS, as the style design code, also contains the design content of usability.
The design of CSS style means that your grasp of the overall style of the website needs to be reconsidered. From the perspective of visual design, in order to achieve maximum reuse and reasonable texture, you need a unified font, font size and layout form. These unified designs are conducive to improving the usability of visual design. The detailed performance on the website, such as link change prompt, link area, navigation sense of operation, etc., are also the goals of CSS usability design. The ultimate goal is to create a better interactive website through good design, so that users can use it and create value for the website and users.

5. Use the basic DOM scripting language to write interactions
DOM is also created to realize cross platform and cross browser applications of scripting languages. The DOM (Document Object Model) is a browser independent interface developed by the W3C. It can technically standardize the standard components (such as HTML tags) in web pages, which can be accessed by scripting languages, provided that the browser supports this DOM based definition specification.
For now, most browsers support standard DOM. Using a script language that conforms to the DOM, it is basically no longer necessary to check different versions of the browser and write several sets of different codes. As long as the browser conforms to the DOM, the same code can complete all supported operations. The current javascript is a script language that conforms to the DOM standard. For more information about DOM, you can visit the W3C DOM column: //www.w3.org/dom


Please contact our consultant

+86 10-60259772

Please provide your contact number. The project manager of shangpin China will contact you as soon as possible.