Reference of CSS styles

Source: Internet
Author: User

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>

 


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.