style" to add a style; 3. Use "" to add styles."/> style" to add a style; 3. Use "" to add styles.">

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

How to import css into jsp

青灯夜游
青灯夜游Original
2021-07-05 15:49:451560browse

Method: 1. Use the style attribute inside the tag to add a style; 2. Use "" to add a style; 3. Use "" to add a style.

How to import css into jsp

The operating environment of this tutorial: windows7 system, CSS3, Dell G3 computer.

Adding css styles to jsp is the same as adding html. There are three ways:

  • Inline styles, using the styles attribute

  • Internal style, use the styleb tag

  • External style, use the link tag

## 1. Inline styles

When a 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. 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>

2. Internal styles

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

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

3. 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. 2cdf5bf648cf2f33323966d7f58a7f3f tag in the head (of the document):

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

Note: Style priority:

Inline styles have the highest priority, followed by It is an internal style, and the external style has the lowest priority.

(Learning video sharing:

css video tutorial)

The above is the detailed content of How to import 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 does px mean in cssNext article:What does px mean in css