Get the App
SLTechnology News&Howtos  ›  Development  › 

How to implement inline, embedded and external in css

Shulou Source: shulou.com Published: 2022-06-01 04:01:26 09月27日 Update

Editor to share with you how to achieve inline, embedded and external css, I hope you will learn something after reading this article, let's discuss it together!

1, inline css style

Just write the css code directly into the existing HTML tag, such as the following code:

The text here is red.

Css style code should be written in style= "" double quotation marks, if there are multiple css style code settings can be written together, separated by semicolons. The code is as follows:

The text here is red.

2, embedded css style

You can write the css style code between the tags. As in the following code, the text in the three tags is set to red:

Span {

Color:red

}

Embedded css styles must be written in between, and generally embedded css styles must be written in between.

3, external css style

Write it in a separate file

External css style (also known as external style) is to write css code into a separate external file. The css style file has the extension ".css" and links the css style file to the HTML file using tags (not within tags), as shown in the following code:

Note:

1. The name of the css style file is named with meaningful English letters, such as main.css.

2. Rel= "stylesheet" type= "text/css" is fixed and cannot be modified.

3. The location of the label is generally written in the label.

After reading this article, I believe you have a certain understanding of "how to achieve inline, embedded and external css". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Tags: Style code label file embedded between that is text red article three location writing semicolon name outreach multiple letter finished quotation mark Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Docker Apple Shulou Information macOS