A reference to CSS styles

Source: Internet
Author: User

Most of the time, in the layout of the need for uniform style, and can not be modified each, so the use of CSS unified style.

Write a common style that requires the dongdong to be called together. If you need to modify the style, you only need to modify the common style.


Here are a few of the steps to create and reference a CSS style:

1. Now create a new folder under the WebContent directory of the project, named style (this random).

Indicates that we have CSS style files in this folder.

2. Right-click within the style folder you just created-new-other choose Create CSS file and name it. I'm named Mystyle.css here.

3. Customize a style in this CSS style file.

. pp {size:24em; color:red;}

I define this as the style that you want to be.

4. Citation notes

References are divided into two parts

One is referenced in a JSP file, the other is referenced in an HTML file, and two is a little bit different.

Reference in the JSP file:

Referencing in an HTML file:

By contrast, you can see the difference in ${pagecontext.request.contextpath} on the path of the project.


5, start the reference (JSP, HTML These two are the same)


<form name= "MyForm" action= "/webtest001/myservlet" method= "POST" > <p class= "pp" > This is a CSS exercise </p> <i Nput class= "pp" type= "button" value= "Send" onclick= "Send ();" ></form>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/74/5E/wKiom1YbVp3zoS8ZAACszaI8QNc294.jpg "title=" 0151012144241.png "alt=" Wkiom1ybvp3zos8zaacszai8qnc294.jpg "/>

This article is from the "climb over the mountains to see the Sea" blog, please be sure to keep this source http://670176656.blog.51cto.com/4500575/1702103

A reference to CSS styles

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.