Home >Web Front-end >Front-end Q&A >How to introduce css into jsp

How to introduce css into jsp

藏色散人
藏色散人Original
2021-06-01 10:10:165703browse

How to introduce css into jsp: 1. Introduce css through "external style"; 2. Introduce css through "internal style"; 3. Introduce css through "inline style".

How to introduce css into jsp

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

How to introduce css into jsp?

1. External styles

When styles need to be applied to many pages, external style sheets will be the ideal choice. With external style sheets, you can change the look of your entire site by changing one file. Each page links to the style sheet using the 2cdf5bf648cf2f33323966d7f58a7f3f tag. 2cdf5bf648cf2f33323966d7f58a7f3fThe tag is in the head (of the document):

<head>
<link rel="stylesheet" type="text/css" href="path/myCss.css"/>
</head>

2. Internal style

When a single document requires a special style, it should Use internal style sheets. Internal style sheets can be defined at the head of the document using the c9ccee2e6ea535a969eb3f532ad9fe89 tag.

<head>
<style type="text/css">
样式
</style>
</head>

3. Inline styles

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 tag. The Style property can contain any CSS property. Inline styles lose many of the advantages of style sheets by mixing presentation with content. Please use this method with caution! !

<div style="width:100px"></div>

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

Recommended learning: "css video tutorial"

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!

Statement:
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
Previous article:what is tag in htmlNext article:what is tag in html