Optimize CSS is the most important on Onpage and I will introduce how to optimize it:
CSS play an important role in design, especially interface design. In addition, we need to arrange CSS in code is suitable , clear and manageable.
I want to share with you how to write CSS well and effectively.
I want to share with you how to write CSS well and effectively.
As attributes margin, we will write complete follows:
1
2
3
4
| margin-top: 40px;margin-right: 30px;margin-bottom: 20px;margin-left: 10px; |
But they are very long and waste file capacity, so you can rewrite as followings:
1
| margin: 40px 30px 20px 10px; |
It is more concise and more effective. With attributes padding, you can do the same.
And its rule: margin: top right bottom left;
And its rule: margin: top right bottom left;
1
2
3
4
5
| border: 1px;border-style: solid;border-color: red;background: url('');background-repeat: repeat; |
We can compact like this:
1
2
| border: 1px solid red;background: url('') repeat; |
It’s more concise, right? And you can combine the same attributes on a line to help you manage it easily.
For examples: Attribute Position, you can combine top, right,…
For examples: Attribute Position, you can combine top, right,…
1
| position : relative; top: 30px; right: 20px;.. |
I hope you will be successful and have many beautiful website.
Source: Consolidate from many SEO resources.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.