How to write css internal style sheet

1. There are three types of CSS style sheets to create and use, namely external style sheets, internal style sheets and inline styles. Below is a small demo to demonstrate their usage.

First create a new html file, put in three button buttons, and set the class attributes to btn1 and btn2 for the first two buttons, as shown below.

2. Then prepare a CSS file named demo. Write the style of buttonA in the css file, and save the css file:

3. HTML file, use the link to introduce the CSS file in the previous step of your style tag tag, which is the outside style, It is to create a good summary in the CSS file writing style, and then introduce the HTML file tag using the link. This is also the method used by most websites, because it is easy to introduce and easier to manage:

4. Continue Next is the use of an internal stylesheet, where the style tab is created directly in the head tab with btn2 styles added. For simple HTML files with internal style sheets, internal styles are convenient, but complex HTML files can be confusing:

5. Finally, use inline styles, using the styles directly in the third tag Properties to add styles can be:

6. Finally, save the HTML file, open a browser and view the styles for all three buttons. This is how CSS stylesheets are made: