This time I will bring you various ways of writing css. What are the precautions for writing css? The following is a practical case, let’s take a look.
Priority, that is: the right side of the selector with the same name will overwrite the left side
1. Internal style sheet
CSS CodeCopy content to clipboard
##
##Headtip {
##: 0xFF5;
##}
2. Use the link tag , the most common way to declare the use of external resources in the document.
@CHARSET="utf-8"; that specifies the encoding of the css external style sheet needs to be placed on the first line.
XML/HTML CodeCopy content to clipboard
##3.@ method, introduce css. Note that this is loaded asynchronously. It is loaded after the entire html is loaded, which will cause the page to Flashing. Not recommended.
CSS Code
Copy content to clipboard
##
4. Inline style sheets have the highest priority and are the most straightforward, but they cannot be reused. Easy to maintain.
XML/HTML Code
Copy content to clipboard
:30px;"/> ##< /body>
I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!
Recommended reading:
Three ways to horizontally and vertically center absolutely positioned elements
Waterfall flow layout and infinite loading Picture album effect
The above is the detailed content of Various ways of writing css. For more information, please follow other related articles on the PHP Chinese website!
Statement:
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 admin@php.cn