Home >Web Front-end >HTML Tutorial >High-end dynamic CSS_html/css_WEB-ITnose

High-end dynamic CSS_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:53:19986browse

Custom css function (dynamic stylesheet) needs to be added to the project. Let’s summarize the implementation method.

1. Dynamically set the file path in JSP

Pre-generate some css files, which are selected by the user. When the jsp is requested, the css file selected by the user is dynamically loaded.

xml code

This method, There is a lot of talk online.

2. Overriding CSS styles

takes advantage of a feature of CSS, that is, when there is a style with the same name, the new style content will overwrite the old one. For elements using the style, the nearest style content is used.

So, we can reference a default style file in , and then dynamically output the customer-customized CSS style to JSP

xml code