How to write CSS code in jsp: 1. Use the tag to define an internal style sheet at the head of the document and write the CSS code; 2. Use the style attribute to write in the relevant tags css code. </p></blockquote> <p><img src="https://img.php.cn/upload/article/202102/01/2021020109533774005.jpg" alt="How to type css code in jsp" ><strong><br></strong></p> <p> The operating environment of this tutorial: Windows 7 system, css3 version, Dell G3 computer. </p> <p><strong>There are two ways to write css code in jsp: </strong></p> <p>Internal style: Use the <style> tag to define an internal style sheet at the head of the document, write css code</p> <p>Inline style: Use the style attribute to write css code within the relevant tag. </p> <p>1. Internal styles</p> <p>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 <style> tag. </p><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false"><style type="text/css"> .loginBtn{ display:block; cursor: pointer; height: 32px; margin-bottom: 1px; width: 100px; } Copy after loginRecommended: "css video tutorial"2. Inline styleBecause the performance and content must be mixed together, inline style Many advantages of style sheets will be lost. 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 loginIn fact, there is another way (recommended) to add css styles in jsp, which is external style External style: When the style needs to be applied to many pages, An external stylesheet would be ideal. 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 tag. hwtt_ui/skins/<%=skinName%>/css/login.css" />Copy after loginThe three methods of inserting CSS styles into JSP pages have different priorities. The details are as follows: external style, internal style, and inline style. The priority increases in order!