The difference between css external linking and inline embedding

藏色散人
Release: 2023-01-03 09:23:45
original
3667 people have browsed it

The differences between css external linking and inline embedding are: 1. The writing methods of the three styles are different; 2. The three methods have different weight priorities in actual use. The order from high to low is "Embedding> ;Inline>Outline".

The difference between css external linking and inline embedding

#The operating environment of this tutorial: Windows 7 system, Dell G3 computer, CSS3 version.

What is the difference between external, inline and embedded css?

First of all, from a functional point of view, the functions of these three implementations are the same, and they can all achieve the typesetting and modification of content.

However, in terms of writing, they are different. Let’s distinguish them one by one:

1, inline style writing

Copy after login

2, external style writing

Write a separate file with css extension, and then use the tag in

to link the css style to html. For example:

Copy after login

3, nested style writing

can be understood as nesting. Now write the required element tags in the text, such as span, and then write a separate css style in in

. For example:




Copy after login

Differences in priorities (Recommended: css video tutorial)

In actual use of the three methods, weight takes priority From high to low: embedded>inline>outline. More general styles are suitable to be isolated and used externally to improve reusability and reduce the coupling between styles and content; styles with few independent elements can be more convenient to use embedded.

The above is the detailed content of The difference between css external linking and inline embedding. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact [email protected]
Latest issues
Popular Tutorials
More>
Latest downloads
More>
web effects
Website source code
Website materials
Front end template
About us Disclaimer Sitemap
PHP Chinese website:Public welfare online PHP training,Help PHP learners grow quickly!