Home >Web Front-end >CSS Tutorial >How to write css inline style
There are several ways to use CSS styles in pages: inline style, inline style, link style and import style.
Inline style
Inline style is to add CSS code directly to the HTML markup, that is, as the attribute tag of the HTML markup exist. In this way, you can easily define styles for an element individually.
Create a new file 02-06.html, enter the following code, create three paragraphs p, and define an attribute style, which is used to define the display style of the paragraph, such as font color and font size.
(2) Press the [F12] key to run, the result is as shown below:
See from the example Inline styles are defined using the style attribute, which can be anywhere in a p tag. At the same time, it can be found that if all labels in a large application use inline styles, the later maintenance investment will be very large. In this regard, the use of inline styles should be avoided as much as possible.
The above is the detailed content of How to write css inline style. For more information, please follow other related articles on the PHP Chinese website!