我们只做一件事,只为您满意--山东微道商网络技术有限公司
当前位置:主页 -> 新闻中心 > 公司新闻

济南网站建设公司前端代码的标准写法详解

来源:http://www.jnzyjz.cn/ 发布时间:2021-05-10

1.尽量满足W3C认证;(系统可自行检测)
1. Try to meet W3C certification( The system can detect by itself)
2.CSS使用外部调用
2. CSS uses external call
3.尽量减少http请求次数:合并JS/CSS、
3. Minimize the number of HTTP requests: merge JS / CSS
4.取消重定向、使用css sprite、缓存静态资源;
4. Cancel redirection, use CSS sprite and cache static resources;
5.压缩页面元素(CSS、JS、图片等),使用Gzip压缩网页,以加快下载速度;
5. Compress the page elements (CSS, JS, pictures, etc.) and use gzip to compress the web page to speed up the download speed;
6.减少网页代码量,清除网页中一些冗余的代码,可以合并代码,必要时可以去掉空格注释等,减小页面体积
济南网站建设公司
6. Reduce the amount of web page code, clear some redundant code in the web page, merge the code, and remove the space comments when necessary, so as to reduce the size of the page
7.CSS放内,JS放页面后(异步除外);除了影响加载的效果文件,合并JS,减少请求
7. CSS is placed inside, JS is placed at the end of the page (except asynchronous); In addition to affect the effect of loading files, merge JS, reduce requests
8.尽量少用第三方库,或使用稳定的三方库。
8. Minimize the use of third-party libraries, or use stable third-party libraries.
9.确保所有的标签都使用小写字母
9. Make sure all labels are in lowercase
10.确保所有的属性值都放在引号里
10. Make sure all attribute values are in quotation marks
11.所有成对标签都保证合理的顺序、不成对的标签都用/>结束, ”/”和”>”之间不要有空格
11. All paired tags should be in a reasonable order, unpaired tags should end with / > and there should be no space between / "and" > "
12.为页面添加正确的DOCTYPE
12. Add the correct DOCTYPE to the page
13.所有属性值加引号
13. All attribute values are quoted
14.闭合所有的标签
14. Close all labels
15.尽量减少嵌套,嵌套时标签必须一一对应
15. Try to reduce nesting, labels must be one-to-one corresponding when nesting
16.清除空格、换行。尽量不用的大段注释
16. Clear the space and wrap. Try not to use large comments
购买产品重要的是质量,选择商家选择是诚信,济南网站建设公司真诚的为广大客户提供优良的服务,欢迎大家在网站:http://www.jnzyjz.cn下方留言咨询.
Jinan website construction company sincerely provides excellent services for our customers. Welcome to our website: http://www.jnzyjz.cn Below message consultation
相关文章
相关推荐