Reference of CSS styles
Most of the time, you need to unify the style in the layout, and it is impossible to modify it one by one, so the CSS uniform style is used. Write a public style and call it together. To modify a style, you only need to modify the public style. The following describes the steps for creating and referencing CSS styles: 1. Create a new folder under the WebContent directory of the project and name it style ). It indicates that the CSS style file is stored in this folder. 2. Right-click the style folder you just created and choose New-Other to create the CSS file and name it. My name is mystyle.css. 3. Customize a style in this css style file.
.pp { size: 24em; color: red;}
You can define the style you want. 4. References are divided into two parts: one is referenced in the JSP file and the other is referenced in the Html file. The two are slightly different. Reference in JSP file:
Reference in Html file:
Through comparison, we can find that the difference lies in $ {pageContext. request. contextPath} on the project Path 5. Start to reference (JSP and Html are the same)
<Form name = "myForm" action = "/WebTest001/myServlet" method = "post"> <p class = "pp"> This is a CSS exercise </p> <input class = "pp" type = "button" value = "send" onclick = "send (); "> </form>