How to introduce css into jsp

藏色散人
Release: 2023-01-05 16:12:55
Original
5057 people have browsed it

How to introduce css into jsp: 1. Use the href attribute in the link tag to introduce the css file path; 2. Use the internal style sheet to introduce css; 3. Inline style to introduce css.

How to introduce css into jsp

The operating environment of this article: Windows 7 system, CSS3 version, Dell G3 computer.

There are three ways to introduce CSS styles into JSP pages, and their priorities are different. The details are as follows: external style, internal style, and inline style. The priority increases in order!

  • jsp can use the href attribute in the link tag to introduce the css file path.

First save the written css style sheet content in *.css format. For example, style.css

introduces this css style file into the page. Introduce it in the following way.

Copy after login

The href="./css/style.css" here refers to the path where the css file is stored. '.'Requests the current directory (that is, the same directory as the jsp page that introduces the css file)

The rel attribute specifies the relationship between the current document and the linked document. In this example, the rel attribute indicates the linked document. is a style sheet.

Two other ways to use css in jsp:

  • Internal style

When When a single document requires special styling, an internal style sheet should be used. Internal style sheets can be defined at the head of the document using the

Copy after login
  • Inline styles

Inline styles lose many of the advantages of style sheets by mixing presentation with content. Use this approach with caution, for example when the style only needs to be applied once to an element. To use inline styles, you need to use the style attribute within the relevant tag. The Style property can contain any CSS property.

Copy after login

For more detailed HTML/CSS knowledge, please visit the CSS Video Tutorial column!

The above is the detailed content of How to introduce css into jsp. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!