style" to add a style; 3. Use "" to add styles."/> style" to add a style; 3. Use "" to add styles.">
Home > Article > Web Front-end > How to import css into jsp
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.
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:
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!