Three ways to insert CSS styles in a JSP page summarize _jsp programming

Source: Internet
Author: User

1. External style

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

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

2. Internal style

When a single document requires a special style, you should use an internal style sheet. You can use the <style> tab to define an internal style sheet in the header of the document.

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

3, inline style

Because you want to mix performance and content together, inline styles can lose many of the advantages of the style sheet. Use this method with caution, such as when a style only needs to be applied on one element at a time. To use inline styles, you need to use style attributes in the relevant tags. The Style property can contain any CSS properties.

Inline styles have the highest precedence, followed by internal styles, and external styles have the lowest precedence.

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.