Post by account_disabled on Dec 12, 2023 8:50:37 GMT
有许多有价值的学习 Web 开发的资源:书籍、视频、在线课程等等。学习使用浏览器的检查元素工具就是这些强大的工具之一。它是一种宝贵的学习工具,随时可用且易于使用。 通过检查元素功能,您可以查看任何网站的内部运作情况。即使您只能看到前端标记(例如 HTML、CSS,有时还包括 JavaScript),您仍然可以看到开发团队如何构建特定网站。 在本文中,我们将向您展示如何使用检查元素工具以及您将遇到的一些相关技术、特性和功能。首先,我们来正式介绍一下Inspect Element工具。 观看我们的视频指南,了解如何使用 Element Inspect 编辑网站 检查元素工具简介 在网络的早期,只有一种方法可以阅读网站的代码:查看源代码。 具有查看源代码的 Kinsta 页面“查看源代码”页面。 这种情况在层叠样式表 (CSS)和JavaScript出现之前就很普遍。从事 Web 开发的人员将 HTML 用于网站的所有元素,包括内容、设计和……嗯,一切。 一旦网络开始发展,底层技术的力量增强,就必须开发更好的工具。Firefox 的 Firebug是一个早期的解决方案,用于了解网站的行为和幕后工作方式: Firefox 和 Firebug 徽标。 Firefox 和 Firebug 徽标。
段时间后,这个功能几乎进入了所有浏览器。今天,我们知道此 电话号码清单 功能的名称为 Inspect Element 或 Inspect Element(取决于您的浏览器的语言): Kinsta 网站上使用的检查元素工具。 Kinsta 网站上的检查元素工具。 这是查看网站代码背后的技术的有效方法。因此,您可以在几个不同的位置找到它:通过工具栏菜单、右键单击页面并选择选项,或者使用键盘快捷键。 虽然检查元素工具主要关注页面的 HTML 和 CSS,但您还可以用它做更多事情。 元素检查面板概览 Brave 的开发工具 Brave 的开发工具。 检查元素工具不仅仅是一种查看代码的方法。通常有几个面板可供访问: 检查器:在某些浏览器中这称为元素。这是检查元素工具的主屏幕,向您显示页面的代码以及特定于元素的 CSS。您还可以找到有关站点“网格系统”和其他详细信息的更多详细信息。 控制台:这是站点前端警报的日志,当您想要测试某个想法时,您还可以在其中放置代码片段以运行快速测试。 网络:在这里您将看到向服务器发出和从服务器发出的请求,以及所有 POST 和 GET 请求。 性能:自然,一个网站必须具有性能。为此,有一个专用工具可以帮助您测量一些基本的站点指标。
在这方面,某些浏览器比其他浏览器工作得更好。 内存:此面板允许您查看站点如何使用内存,并且某些浏览器再次提供了广泛的指标。 应用程序:在此面板中您可以看到有关站点缓存、后台服务等的一系列信息。 除此之外,您还可以添加其他面板: Brave DevTools 中的附加面板列表。 Brave DevTools 中其他面板的列表。 有简单的面板,如Media,也有更复杂的面板,如JavaScript 工具的名称并未表达其底层所有功能的完整性。它具有巨大的功能,应该成为任何从事 Web 开发工作的人的工作流程的核心。 为什么使用检查元素? Inspect Element 工具几乎是您在开发过程中需要的唯一解决方案。我们将在本文的其余部分深入研究技术细节来解释原因。不过,首先值得谈谈使用 Inspect Element 的原因。 您想要使用此工具的原因有以下几个: 您可以浏览其他网站以获取有关如何独立工作的灵感。 您将了解其他网站或开发人员如何实施某些技术。 它使您能够在自己的网站上进行实验,而不会产生任何后果。 在大多数 Inspect Element 工具中,您都可以调试站点。 它对于了解有关该网站的更多信息很有用。 简而言之,学习网络开发涉及查看网站的优秀示例并找出它们的工作原理。
段时间后,这个功能几乎进入了所有浏览器。今天,我们知道此 电话号码清单 功能的名称为 Inspect Element 或 Inspect Element(取决于您的浏览器的语言): Kinsta 网站上使用的检查元素工具。 Kinsta 网站上的检查元素工具。 这是查看网站代码背后的技术的有效方法。因此,您可以在几个不同的位置找到它:通过工具栏菜单、右键单击页面并选择选项,或者使用键盘快捷键。 虽然检查元素工具主要关注页面的 HTML 和 CSS,但您还可以用它做更多事情。 元素检查面板概览 Brave 的开发工具 Brave 的开发工具。 检查元素工具不仅仅是一种查看代码的方法。通常有几个面板可供访问: 检查器:在某些浏览器中这称为元素。这是检查元素工具的主屏幕,向您显示页面的代码以及特定于元素的 CSS。您还可以找到有关站点“网格系统”和其他详细信息的更多详细信息。 控制台:这是站点前端警报的日志,当您想要测试某个想法时,您还可以在其中放置代码片段以运行快速测试。 网络:在这里您将看到向服务器发出和从服务器发出的请求,以及所有 POST 和 GET 请求。 性能:自然,一个网站必须具有性能。为此,有一个专用工具可以帮助您测量一些基本的站点指标。
在这方面,某些浏览器比其他浏览器工作得更好。 内存:此面板允许您查看站点如何使用内存,并且某些浏览器再次提供了广泛的指标。 应用程序:在此面板中您可以看到有关站点缓存、后台服务等的一系列信息。 除此之外,您还可以添加其他面板: Brave DevTools 中的附加面板列表。 Brave DevTools 中其他面板的列表。 有简单的面板,如Media,也有更复杂的面板,如JavaScript 工具的名称并未表达其底层所有功能的完整性。它具有巨大的功能,应该成为任何从事 Web 开发工作的人的工作流程的核心。 为什么使用检查元素? Inspect Element 工具几乎是您在开发过程中需要的唯一解决方案。我们将在本文的其余部分深入研究技术细节来解释原因。不过,首先值得谈谈使用 Inspect Element 的原因。 您想要使用此工具的原因有以下几个: 您可以浏览其他网站以获取有关如何独立工作的灵感。 您将了解其他网站或开发人员如何实施某些技术。 它使您能够在自己的网站上进行实验,而不会产生任何后果。 在大多数 Inspect Element 工具中,您都可以调试站点。 它对于了解有关该网站的更多信息很有用。 简而言之,学习网络开发涉及查看网站的优秀示例并找出它们的工作原理。