" tag to define an internal style sheet at the head of the document; 3. Use the "" tag to link to the style surface."/> " tag to define an internal style sheet at the head of the document; 3. Use the "" tag to link to the style surface.">

Home  >  Article  >  Web Front-end  >  How to write css style in jsp

How to write css style in jsp

藏色散人
藏色散人Original
2020-12-17 10:13:063301browse

How to write css style in jsp: 1. Write it in jsp through inline style; 2. Use the "c9ccee2e6ea535a969eb3f532ad9fe89" tag to define an internal style sheet at the head of the document; 3. Use "< ;link>" tag links to the style sheet.

How to write css style in jsp

The operating environment of this tutorial: windows7 system, css3 version. This method is suitable for all brands of computers.

Recommended: "css video tutorial"

css style is written in jsp:

1. Inline style

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 style

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

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

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>

Priority comparison:

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

The above is the detailed content of How to write css style in 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