CSS architecture in BS Project _ loading only the CSS you need

Source: Internet
Author: User

Let's talk about the advantages of this architecture:
1. You can easily allocate heavy CSS compilation tasks without affecting each other.
2. Clear structure, facilitating maintenance and modification.
3. Each page only loads the CSS you need.

The conclusion is: improve development efficiency, maintenance efficiency, and webpage loading efficiency.

The above CSS structure is explained below:

The five black icons in the middle of the figure represent the webpage. One of them is the master page, and the other four are subpages. Anyone who uses vs knows the role of the master page, which is equivalent to include in ASP. They make the common part as the master page, and separate the part as a sub-page to improve development efficiency.

In the green box above the figure, the global CSS section is stored in the styles folder, called by the master and applied to all subpages.

The blue dotted box above the figure is a single CSS part, and each subpage has a corresponding folder to store its own CSS file. They are stored in the styles/X folder. Controlled by the corresponding C # file: when different subpages are opened, the master node loads the CSS of the current page.

The red box in the lower-left corner of the image is the topic to store global styles and images. The function is the same as that of the Green Box, except that it is loaded by subpages rather than the master node. This section does not affect the combination of green boxes.

Next I will introduce how to use so many CSS files?

-ADM/styles
--Basic.css global basic style
--Layout.css global layout style (dimensions, positioning, etc)
--General.css global aesthetic style (color, image, etc)
-ADM/styles/groupmanager folder (example)
--Group_layout.css the layout style unique to the group page
--Group_general.css beautiful style unique to the group page

Calling so many CSS will bring about a large number of server requests. The solution is attached below.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.