Project Technical Experience Summary 2: Implementation of multiple system styles

Source: Internet
Author: User
In the just-completed system (based on asp.net), the system provides multiple styles and users can choose the system style freely. we implemented this function simply and effectively by replacing the css style file. the implementation steps are as follows:
1.define the csssample file, which can be named style_blue.css and so on:
2. Set the Class in the corresponding css on each program page (*. aspx)
3. When logging on to the system, the user obtains the set style (the value is the css file name, such as style_blue) and saves it by Session.
4.go to the specific page and obtain the CSS style from session. the CSS file corresponding to the file header (such as style_blue.css)
Of course, multiple css files must be premade if multiple styles are required.
Compared with the practice of writing the color values of page elements in the database and then reading them,
Advantages:
Less workload, no need to deal with the database multiple times (read the css file name set by the user only when entering the system)
Disadvantage: the style of page elements cannot be set by the user. However, setting the page elements by the user requires the user to have a certain aesthetic basis. This disadvantage is generally negligible in the application system.
Appendix 1: css style files
A: link, A: active, A: visited {TEXT-DECORATION: none; Color: #000000}
A: hover {TEXT-DECORATION: underline; Color: # 4455aa }.
SelectedItem
{
Background-color: # 8AC8DF;
}
BODY
{
Font-family: verdana, sans-serif; FONT-SIZE: 9pt; BACKGROUND-COLOR: # F6f6f6;
Scrollbar-face-color: # DEE3E7;
Scrollbar-highlight-color: # FFFFFF;
Scrollbar-shadow-color: # DEE3E7;
Scrollbar-3dlight-color: # D1D7DC;
Scrollbar-arrow-color: #006699;
Scrollbar-track-color: # EFEFEF;
Scrollbar-darkshadow-color: #98AAB1;
}
. Table_table
{
Font-family: verdana, sans-serif;
FONT-SIZE: 9pt;
BACKGROUND-COLOR: #4682b4
}
. Table_head
{
Font-family: verdana, sans-serif;
FONT-SIZE: 10pt;
BACKGROUND-COLOR: # C1D0E1;
COLOR: # ffffff;
Background-image: url(blue.gif );
}
. Table_strong
{
Font-family: verdana, sans-serif;
FONT-SIZE: 9pt;
BACKGROUND-COLOR: #4682b4;
COLOR: # ffffff;
Font-weight: bold;
}
. Table_trline
{
Font-family: verdana, sans-serif;
FONT-SIZE: 9pt;
BACKGROUND-COLOR: # C1D0E1;
HEIGHT: 19pt;
TEXT-ALIGN: CENTER;
COLOR: # ffffff;
Font-weight: bold;
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.