Three ways to parse CSS styles into a JSP page

Source: Internet
Author: User
This article is mainly on the JSP page inserted CSS style of three methods to summarize the introduction, the need for friends can come to the reference, I hope to be helpful to everyone

1. External style

An external style sheet is an ideal choice when the style needs to be applied to many pages. With an external style sheet, you can change the appearance of the entire site by changing a file. Each page uses <link> tags to link to the style sheet. <link> tags at the head of (document):

<link rel= "stylesheet" type= "Text/css" href= "Path/mycss.css"/>

2. Internal style

An internal style sheet should be used when a particular style is required for a single document. You can use the <style> tag to define an internal style sheet at the head of the document.

<style type= "Text/css" >
Style
</style>

3. Inline style

Inline styles lose many of the benefits of stylesheets because of the mix of performance and content. Use this method with caution, such as when the style only needs to be applied once on one element. To use inline styles, you need to use style properties within the relevant tags. The Style property can contain any CSS properties.

Inline styles have the highest precedence, followed by internal styles, with the lowest priority for external styles.

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.