This time I will bring you CSS usage skills that you don’t know. What are the precautions when using CSS? Here are practical cases, let’s take a look.
In enterprise development, modifying styles is done by CSS
What are the benefits of modifying styles through CSS?
1. No need to memorize Which attributes belong to which tags
2. When the requirements change, we do not need to modify a lot of code to meet the requirements
3. In front-end development, CSS has only one role, which is to modify the style
Fixed format
1. Format:
<style type="text/css"> 标签名称{ 属性名称: 属性对应的值; ... }</style>
2. Notes:
1. The style tag must be written at the beginning of the head tag Between the tag and the end tag (that is, it must be a sibling relationship with the title tag)
2. The type attribute in the style tag does not need to be written. The default is type="text/css", which is the user's This means telling the system that this pair of style tags stores text-type css code
3. When setting the style, it must be set in a fixed format. key: value;
where: cannot be omitted, semicolon In most cases, it cannot be omitted.
4. How to learn CSS?
CSS learning is divided into two parts, one is CSS properties, and the other isCSS selector . In other words, after learning these two parts of CSS, there will be nothing else.
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:
How to load HTMLString in iOS webView
html5 little knowledge that is easily overlooked
A few small exercises about regular expressions
Why does the constructor not prompt in swift?
The above is the detailed content of CSS usage skills you don't know. For more information, please follow other related articles on the PHP Chinese website!