Whether you're looking for dining recommendations, ordering groceries, reading your favorite blog, or shopping for holiday gifts, the internet is the first place we turn to for information and convenience. Naturally, the best companies are positioned to catch a potential customer's attention well before they ever walk through the door with a professional and seamless website.

很容易talkabout having a website, but if you're a small business owner or fledgling entrepreneur, it's hard to know where to start. Fortunately, we've broken down the process of how to code a website into a few simple steps.

立即下载:HTML&CSS的免费介绍指南

在我们深入研究之前,我想花点时间回答许多首次网站建设者遇到的两个常见问题。

Frequently Asked Questions About Coding a Website

1.编码网站需要多长时间?

Answer:it depends on the complexity of your website. For example, it will take a lot less time to launch a basic homepage with your business's address, contact information, and links to social media accounts than it will to build an online ordering portal that collects users' shipping information and processes payments.

However, just because you save time in the beginning doesn't mean that more advanced features aren't worthwhile. It depends on your business. If you are only trying to get foot traffic to your store, then online ordering doesn't make sense.

也就是说,您可能会错过可能不喜欢开车去实际位置而是would通过您的网站购买。如果您没有将物品运送到客户的带宽,那么这是传递创建电子商务网站的另一个好理由。

2.我需要编码我的网站吗?

简单答案:While everyone was manually coding their sites in the early days of the internet, many websites are now built with acontent management system (CMS)。CMS通过提供视觉界面来构建网页并构建网站来消除编码的需求。许多CMS都提供拖放功能,因此您可以轻松地将元素(例如按钮)放置在页面上。

我们的团队汇编了best CMSs我建议您阅读,如果您宁愿避免自定义编码路线。如果您准备学习一些代码,让我们一起浏览此过程。

1.选择您的代码编辑器。

代码编辑器是新开发人员的绝佳工具,因为它们提供了许多使我们生活更轻松的功能。例如,Visual Studio代码(我的选择)将提供语法建议,以便您避免使用代码中引起问题的简单错别字。最重要的是,它将为HTML自动完成关闭标签,并在文件中添加视觉标记,以便您可以轻松地分解不同的代码。

You can see the difference between a regular text editor and a code editor below. The code works the same in both documents, but one is much easier to understand at a glance than the other.

Notepad UI与VS代码UI

As I said before, Visual Studio Code is my preferred tool, but there are many免费代码编辑器out there for you to choose from. Visual Studio Code has extensions that add additional functions to the editor (like switching from dark to light mode) and a dedicated user base that is constantly creating more, but the most important thing is that you have a code editor for these next steps. The brand is not critical.

Note: I will be sharing screenshots from Visual Studio Code, so it will be easy to follow along in this tool as we dive into coding in the next step.

2. Write your HTML.

HTML代表超文本标记语言。如果现在没有意义,请不要担心。少关注定义,而更多地关注这张图片:我们正在建造房屋。最自然的起点是粉底,墙壁和屋顶,因为每个房屋都需要这些,然后再担心室内装饰或绘画。

With HTML, we're able to build this structure for our website. This is a metaphor I use when I lead HTML and CSS trainings, so we'll repurpose it for this tutorial as well.

普通的剪贴画房

Image Source

现在,我们拥有合适的工具来完成工作并了解我们的目标,现在该深入了解您在这里的原因:编码。

创建一个HTML文档。

我们所有的编码都将发生在我们保存到本地计算机的不同文件中。我们将创建的第一个文件是我们的HTML文档。首先,为您的网站文件制作新文件夹。由于我正在演示,所以我创造性地将我的名字称为“演示”。

带有演示文件夹的文件资源管理器的屏幕截图

现在打开代码编辑器中的文件夹。接下来,创建一个名为“ index.html”的文件,现在我们准备了第一个HTML文件。请注意,您不需要将文件命名为“索引”,但是您doneed to match the ".html" file extension. This tells our computer (and later our web browser) that this is an HTML document instead of a JPG, PDF, etc.

vs in index.html文件的代码

Our file is currently blank, so let's add the HTML document structure. I have laid everything out in the snippet below so you can copy and paste into your file (or write it out).

让我们简要回顾这些部分:

  • <!doctype html>:向浏览器声明这是一种HTML文档类型,该类型将讲述如何处理我们的代码
  • :包装我们所有HTML的开放标签,以便浏览器知道我们的代码从哪里开始及其结束的位置(请注意关闭 tag)
  • :包含有关我们网页的所有不可见信息的开放标签,也称为元数据- 我们将在下一部分中仔细研究(请注意关闭标签)
  • :一个开放标签,用于包含我们网页上所有可见内容 - 我们将在本节中添加元素(请注意关闭标签)

Note:如果您不太熟悉HTML语法,我建议我们HTML guideas a good way to brush up on your skills before continuing.

Add metadata to your head.

Metadata is defined as data about the data. In the scope of our HTML document, think of it as information about the document for the web browser. It is housed under the, which separates our metadata from the我们的内容将居住的地方(请记住下一节)。让我们在我们的下添加一些元数据

Stephen的网站

The</strong>HTML元素告诉浏览器我们希望我们的网页命名。例如,如果我启动文件,我们将在“浏览器”选项卡中看到“ Stephen的网站”:</p><p><img alt="镀铬标签显示网页名称" src="//www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-4.png?width=650&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-4.png" style="margin-left: auto; margin-right: auto; display: block; width: 650px;" title="" width="650" srcset="//www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-4.png?width=325&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-4.png 325w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-4.png?width=650&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-4.png 650w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-4.png?width=975&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-4.png 975w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-4.png?width=1300&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-4.png 1300w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-4.png?width=1625&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-4.png 1625w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-4.png?width=1950&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-4.png 1950w" sizes="(max-width: 650px) 100vw, 650px"></p><p>Don't worry about understanding the<strong><meta charset =“ utf-8”></strong>tag for now. Just know that it is a<a rel="noopener" target="_blank" href="//www.eigoj.com/website/what-is-utf-8">网络开发最佳实践</a>to include it in your<strong><head></strong>。</p><h4>Add content to your body.</h4><p>现在,我们已经将元数据平衡了,我已经继续前进,并将内容添加到了我们的网页中,因此我们(终于)有一些可以查看的内容。您可以在此处查看更新的HTML<strong><body></strong>在左侧以及用户将在右侧看到的内容。</p><p class="codepen" data-height="400" data-default-tab="html,result" data-slug-hash="ZEJVBJj" data-editable="true" data-user="hubspot" style="height: 400px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;"><span>See the Pen<a href="https://codepen.io/hubspot/pen/ZEJVBJj">如何编码网站示例:基本HTML文档</a>由HubSpot(<a href="https://codepen.io/hubspot">@hubspot</a>) on<a href="https://codepen.io">CodePen</a>。</span></p><p>让我们简要回顾这些新元素中的每一个:</p> <ul> <li><h1>: The main title for our web page. HTML has heading levels 1-6 (i.e. <h1>-<h6>). It will display the largest by default since it's given the most weight (we'll learn how to manipulate displays when we get to CSS), and it's a best practice to only have<em>一</em><h1>在页面上。</li> <li><p>:段落元素。</li> <li><img>:图像元素。请注意,<img>没有关闭标签。这是因为它没有文字可以包裹(<h1>和<p>做)。</li> </ul><p>Before we continue, I want to take a moment to discuss HTML attributes. We can see two different examples inside the<strong>img</strong>标签。首先,“ SRC”是图像的属性<em>来源</em>这告诉浏览器要显示哪个图像。第二,“ alt”是一个属性<em>alternate</em>如果无法呈现图像,则告诉浏览器浏览器显示什么文本。Alt文本对于可访问性也很重要,因此屏幕读取器可以向用户描述图像。</p><p><strong>Note</strong>: the order of the attributes inside your HTML tag does not matter as long as they are all inside the tag.</p><h4>检查您的工作。</h4><p>If you've made it this far, you're probably excited to see your hard work on the big screen (AKA web browser). The simplest way to do this is to return to your File Explorer and right click your HTML file:</p><p><img alt="使用Google Chrome打开的index.html文件的文件资源管理器" src="//www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-68-PM.png?width=650&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-68-PM.png" style="margin-left: auto; margin-right: auto; display: block; width: 650px;" title="" width="650" srcset="//www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-68-PM.png?width=325&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-68-PM.png 325w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-68-PM.png?width=650&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-68-PM.png 650w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-68-PM.png?width=975&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-68-PM.png 975w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-68-PM.png?width=1300&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-68-PM.png 1300w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-68-PM.png?width=1625&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-68-PM.png 1625w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-68-PM.png?width=1950&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-68-PM.png 1950w" sizes="(max-width: 650px) 100vw, 650px"></p><p>Once you've selected your web browser of choice (I recommend Chrome, but any will work), you should see your HTML file displaying like it's a live web page. Don't worry, only you can see it for now.</p><p><img alt="带有H1,段落和笑脸的演示网页" src="//www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-91-PM.png?width=650&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-91-PM.png" style="margin-left: auto; margin-right: auto; display: block; width: 650px;" title="" width="650" srcset="//www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-91-PM.png?width=325&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-91-PM.png 325w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-91-PM.png?width=650&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-91-PM.png 650w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-91-PM.png?width=975&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-91-PM.png 975w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-91-PM.png?width=1300&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-91-PM.png 1300w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-91-PM.png?width=1625&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-91-PM.png 1625w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-91-PM.png?width=1950&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-24-91-PM.png 1950w" sizes="(max-width: 650px) 100vw, 650px"></p><p><strong>Note</strong>:如果进行其他更改,则需要保存文件,然后刷新页面以查看它们在浏览器中生效。当我们回顾如何在下一节中更改页面的美学时,这将更加重要。</p><h3>3. Create your CSS stylesheet.</h3><p>Let's return to the metaphor from the last section. We now have our house's structure. But you may have noticed that — like the clipart house graphic — our HTML is uniform and lacks color. We can see all of it, but clearly there's a lot more that can be done with HTML than its default display. We'll turn to CSS to give our "house" some flair.</p><p><img alt="Suburban home" src="//www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload).jpeg?width=650&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload).jpeg" style="margin-left: auto; margin-right: auto; display: block; width: 650px;" title="" width="650" srcset="//www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload).jpeg?width=325&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload).jpeg 325w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload).jpeg?width=650&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload).jpeg 650w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload).jpeg?width=975&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload).jpeg 975w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload).jpeg?width=1300&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload).jpeg 1300w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload).jpeg?width=1625&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload).jpeg 1625w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload).jpeg?width=1950&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload).jpeg 1950w" sizes="(max-width: 650px) 100vw, 650px"></p><p style="text-align: center; font-size: 13px;"><em><a rel="noopener" target="_blank" href="https://www.google.com/url?sa=i&url=https%3A%2F%2Fgiggster.com%2Flisting%2Fidyllic-suburban-house&psig=AOvVaw3cfIF3o0HkWrzHPYm8JJFF&ust=1637353799906000&source=images&cd=vfe&ved=0CAwQjhxqFwoTCJiHsrTgovQCFQAAAAAdAAAAABAD" style="font-weight: normal;">Image Source</a></em></p><p>CSS stands for Cascading Style Sheets. If you're unfamiliar with CSS, I recommend starting with our<a rel="noopener" target="_blank" href="//www.eigoj.com/website/css-tutorial">CSS指南</a>审查属性,语法,选择器和特异性的较好点。我们将通过如何实现CSS进行下面的操作。</p><h4>Create the CSS doc.</h4><p>就像我们创建“ index.html”文件一样,现在我们将创建我们的“ style.css”文件来存储我们的CSS规则。同样,文件的名称无关紧要,但是您必须包括“<strong>.css</strong>" extension.</p><p><img alt="vs with style.css文件" src="//www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-44-PM.png?width=650&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-44-PM.png" style="margin-left: auto; margin-right: auto; display: block; width: 650px;" title="" width="650" srcset="//www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-44-PM.png?width=325&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-44-PM.png 325w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-44-PM.png?width=650&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-44-PM.png 650w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-44-PM.png?width=975&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-44-PM.png 975w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-44-PM.png?width=1300&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-44-PM.png 1300w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-44-PM.png?width=1625&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-44-PM.png 1625w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-44-PM.png?width=1950&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-44-PM.png 1950w" sizes="(max-width: 650px) 100vw, 650px"></p><h4>添加CSS规则。</h4><p>目前,我们将重点介绍在我们的CSS文件中添加一个规则。在这种情况下,我希望所有段落显示为红色文本。</p><p></p><pre class="syntax"><code class="css"><p></p><p>p {</p><p>color: red;</p><p>}</p></code><p><code class="css"></code></p></pre><p></p><p>选择器“ P”告诉我们要针对HTML中的所有段落的CSS,并应用括号({})中列出的属性。在这种情况下,我们拥有一个设置为“红色”值的属性“颜色”,但是我们可以根据需要添加尽可能多的规则属性。</p><p>您可能会注意到,在将此CSS规则添加到文件中后,页面上没有任何事情。那是因为我们需要将HTML和CSS链接在一起,我们将在下一节中显示。</p><h3>4. Put your HTML and CSS together.</h3><p>For our CSS to affect our HTML, we need to tell the browser to apply the CSS. The process to do this is straightforward. We simply need to add a<strong><link></strong>我们的元素<strong><head></strong>。</p><p></p><pre class="syntax"><code class="html"><p></p><p><link rel =“ stylesheet” href =“ style.css”></p></code><p><code class="html"></code></p></pre><p></p><p>Once again, we see HTML attributes in action. Adding the <link> tag without the "rel" and "href" attributes would produce no results since the browser would not know the link type (stylesheet) and where to link to (style.css). Note that if you have named your CSS file differently, then the value for the href attribute within the quotes (" ") should be updated to match your file name. Otherwise, the browser will not be able to find your stylesheet.</p><p class="codepen" data-height="300" data-default-tab="html,result" data-slug-hash="mdMagej" data-editable="true" data-user="hubspot" style="height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;"><span>See the Pen<a href="https://codepen.io/hubspot/pen/mdMagej">How to Code Website Example: HTML Doc with CSS Link</a>由HubSpot(<a href="https://codepen.io/hubspot">@hubspot</a>) on<a href="https://codepen.io">CodePen</a>。</span></p><h4>更多CSS规则</h4><p>现在,我们的HTML和CSS已链接,我将添加更多规则,以使我们的页面看起来较少一些。</p><p class="codepen" data-height="300" data-default-tab="css,result" data-slug-hash="jOLXRGb" data-editable="true" data-user="hubspot" style="height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;"><span>See the Pen<a href="https://codepen.io/hubspot/pen/jOLXRGb">如何编码网站示例:更多CSS规则</a>由HubSpot(<a href="https://codepen.io/hubspot">@hubspot</a>) on<a href="https://codepen.io">CodePen</a>。</span></p><p>Let's review each of our new rules:</p> <ul> <li><strong>Body rule</strong>:将我们身体的背景颜色(又称可见页面)从白色变为浅灰色</li> <li><strong>H1规则</strong>:缩小我们的主页标题的字体尺寸</li> <li><strong>Text class rule</strong>:更改i标记使用“类”属性的任何元素的颜色到绿色(其上方覆盖段落规则)</li> <li><strong>笑脸ID规则</strong>:将我笑脸图像的宽度更改为300px,并将高度设置为自动扩展</li> </ul><p><strong>Note</strong>: Any class or id rules that you write in your HTML also means that you must tag the specific elements that you want to target in your HTML with the corresponding "class" or "id" attribute plus the name as written in our CSS.</p><h3>5.编码响应式网站或静态网站。</h3><p>要了解网络响应能力,我们将再次转向隐喻。一方面,我们有一个池塘。池塘内的水总是相同的形状,因为池塘的边缘永远不会改变。另一方面,我们有一个流。流动时的边缘总是在变化,水总是在膨胀和缩小以适合这种形状。</p><p><img alt="池塘与流" src="//www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-2.jpeg?width=650&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-2.jpeg" style="margin-left: auto; margin-right: auto; display: block; width: 650px;" title="" width="650" srcset="//www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-2.jpeg?width=325&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-2.jpeg 325w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-2.jpeg?width=650&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-2.jpeg 650w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-2.jpeg?width=975&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-2.jpeg 975w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-2.jpeg?width=1300&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-2.jpeg 1300w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-2.jpeg?width=1625&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-2.jpeg 1625w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-2.jpeg?width=1950&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-2.jpeg 1950w" sizes="(max-width: 650px) 100vw, 650px"></p><p>我们可以以相同的方式想到静态和响应迅速的网站。静态网站对浏览器大小的变化没有反应。它的内容总是相同的形状。同时,响应式网站不断适应不同的浏览器和屏幕尺寸。</p><p>Why does responsiveness matter? In 2021, mobile traffic now makes up more than 55% of all traffic on the internet, according to<a rel="noopener" target="_blank" href="https://gs.statcounter.com/platform-market-share/desktop-mobile/worldwide/">StatCounter</a>。If your website can’t accommodate traffic on small phone screens up to smart TVs, then you are losing potential customers. Additionally, Google ranks mobile friendliness as part of its decision to show pages in search results, so you can lose organic traffic as well.</p><p>到目前为止,我们已经创建了一个静态网站。默认情况下,文本元素将调整大小,但是无论显示如何变化,其他元素都会保持其原始形状和尺寸。在下面,我们可以看到我们的笑脸的右侧被切断了,因为现在的视口比其300像素的固定宽度要窄(请注意,我们的段落已将其文本包裹为适合)。</p><p><img alt="网页大小以下300像素以显示切断的笑脸" src="//www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-1.png?width=450&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-1.png" style="margin-left: auto; margin-right: auto; display: block; width: 450px;" title="" width="450" srcset="//www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-1.png?width=225&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-1.png 225w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-1.png?width=450&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-1.png 450w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-1.png?width=675&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-1.png 675w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-1.png?width=900&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-1.png 900w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-1.png?width=1125&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-1.png 1125w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-1.png?width=1350&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-1.png 1350w" sizes="(max-width: 450px) 100vw, 450px"></p><h4>Meta Viewport Tag</h4><p>Before we continue, there's another tag we'll want to add to our<strong><head></strong>that is<em>很重要</em>:</p><p></p><pre class="syntax"><code class="html"><p></p><p><meta name="viewport" content="width=device-width, initial-scale=1"></p></code><p><code class="html"></code></p></pre><p></p><p>The<strong>元</strong>治疗像素标记告诉所有的浏览器和设备measurements the same. In other words, mobile devices and browsers will shrink your page to the same scale as it would display on a desktop, which we can see below.</p><p><img alt="Mobile screen showing webpage scaled to display at desktop proportions" src="//www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-21-PM.png?width=450&height=806&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-21-PM.png" style="margin-left: auto; margin-right: auto; display: block;" title="" width="450" height="806" srcset="//www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-21-PM.png?width=225&height=403&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-21-PM.png 225w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-21-PM.png?width=450&height=806&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-21-PM.png 450w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-21-PM.png?width=675&height=1209&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-21-PM.png 675w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-21-PM.png?width=900&height=1612&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-21-PM.png 900w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-21-PM.png?width=1125&height=2015&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-21-PM.png 1125w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-21-PM.png?width=1350&height=2418&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-Nov-22-2021-02-26-23-21-PM.png 1350w" sizes="(max-width: 450px) 100vw, 450px"></p><p>显然,对于电话屏幕而言,此内容太小了,用户将不得不放大以查看它。因此,添加<strong>元</strong>viewport tag to our<strong><head></strong>将标准化所有浏览器和设备的缩放。</p><p><img alt="移动屏幕显示缩放的内容以形成比例显示" src="//www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.png?width=468&height=808&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.png" style="margin-left: auto; margin-right: auto; display: block;" title="" width="468" height="808" srcset="//www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.png?width=234&height=404&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.png 234w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.png?width=468&height=808&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.png 468w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.png?width=702&height=1212&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.png 702w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.png?width=936&height=1616&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.png 936w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.png?width=1170&height=2020&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.png 1170w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.png?width=1404&height=2424&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.png 1404w" sizes="(max-width: 468px) 100vw, 468px"></p><p>This is already looking better, and now we can be sure our page will behave consistently across devices and screen sizes, which will save us a lot of frustration. We can now optimize our web page for mobile using media queries and fluid design practices.</p><h4>Media Queries</h4><p>媒体查询是CSS规则,该规则指示CSS根据视口的宽度行为不同(又称网页显示在屏幕/浏览器宽度中)。您定义了该宽度以及CSS的变化。</p><p>For example, I've increased our smiley face's width to 400 pixels so that it has more presence on larger screens. However, I want to make sure it's not cut off on smaller screens. So, I wrote a media query that states that once the screen is 400 pixels wide or smaller, reduce the smiley face's width to 300 pixels.</p><p></p><pre class="syntax"><code class="css"><p></p><p>@Media仅屏幕和(最大宽度:400px){</p><p>#smiley {</p><p>width: 300px;</p><p>}</p><p>}</p></code><p><code class="css"></code></p></pre><p></p><p>I've added the media query to the end of our CSS stylesheet. Make sure they always come<em>after</em>your regular CSS rules and group them sequentially. For example, a 500 pixel-media query comes before a 400-pixel media query.</p><p class="codepen" data-height="619" data-default-tab="css,result" data-slug-hash="yLoGdwB" data-editable="true" data-user="hubspot" style="height: 619px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;"><span>See the Pen<a href="https://codepen.io/hubspot/pen/yLoGdwB">How to Code Website Example: Media Query</a>由HubSpot(<a href="https://codepen.io/hubspot">@hubspot</a>) on<a href="https://codepen.io">CodePen</a>。</span></p><h4>流体设计</h4><p>如果我们想将元素保持固定宽度,媒体查询效果最好。正如您在上面看到的那样,我希望我的笑脸显示为400像素宽,然后缩放回到300像素。但是,当屏幕达到300像素宽度时会发生什么?我需要另一个媒体查询才能再次降低其尺寸。</p><p>另一种方法是流体设计,它基于相对单位的使用。到目前为止,我们一直在使用绝对单元:像素。无论屏幕上发生什么,像素始终是相同的确切测量单元。为了让您了解这意味着什么,96像素等于1英寸,192像素等于两英寸,等等。</p><p>相对单位与它们所处的环境相对。在我们的代码中,笑脸图像元素的环境是身体,它是一个跨越整个页面的容器。我们将使用的相对单位是将我的笑脸设置为等于身体宽度比例的百分比。例如,如果身体宽400像素,笑脸的脸部设置为容器宽度的50%,则是200像素宽。</p><p class="codepen" data-height="500" data-default-tab="css,result" data-slug-hash="XWaovgM" data-editable="true" data-user="hubspot" style="height: 500px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;"><span>See the Pen<a href="https://codepen.io/hubspot/pen/XWaovgM">How to Code Website Example: Relative Units</a>由HubSpot(<a href="https://codepen.io/hubspot">@hubspot</a>) on<a href="https://codepen.io">CodePen</a>。</span></p><p>Now I no longer need a media query; the smiley face will always scale to fill the container to the amount specified. In other words, it's<em>fluid</em>。However, don't write media queries off just yet.</p><h4>Using Media Queries and Fluid Design</h4><p>尽管它们看起来像是相反的,但媒体查询和流体设计搭配得很好,可以实现响应能力。我最喜欢的技巧是将CSS属性“最大宽度”设置为最大像素计数,并将“宽度”设置为一个百分比。以下面的示例为例。</p><p class="codepen" data-height="500" data-default-tab="css,result" data-slug-hash="XWaovgM" data-editable="true" data-user="hubspot" style="height: 500px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;"><span>See the Pen<a href="https://codepen.io/hubspot/pen/XWaovgM">How to Code Website Example: Media Query and Relative Units</a>由HubSpot(<a href="https://codepen.io/hubspot">@hubspot</a>) on<a href="https://codepen.io">CodePen</a>。</span></p><p>I have my smiley face initially at a fixed width of 400 pixels. Then I scale it back to 300 pixels when the viewport reaches 400 pixels. Then I set it to a maximum width of 300 pixels but to scale down to always be 100% of the available width of the container for any screens<em>smaller</em>than 300 pixels.</p><h3>6.编码简单的网站或交互式网站。</h3><p>我们(您猜对了)将我们的朋友带回本节的隐喻。想象一下,您站在街上读书的吉他课上的传单上。您有兴趣,传单说要打电话给一个号码注册。</p><p>这就是我们认为一个简单的网站。它显示有关某物的信息,甚至可能要求您采取行动,但是阅读是您(用户)在网站上可以做的事情的程度。请记住,您需要调用它在手机上给您的电话。</p><p>我们回到了砖墙。现在,有一个标语在谈论吉他课和一扇门进入工作室,以便如果您有兴趣。墙仍在显示信息,但是现在您可以与之互动以采取下一步。这就是我们认为的<em>交互的</em>网站。看看名字来自何处?</p><p><img alt="Sign on wall versus door in wall" src="//www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.jpeg?width=650&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.jpeg" style="margin-left: auto; margin-right: auto; display: block; width: 650px;" title="" width="650" srcset="//www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.jpeg?width=325&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.jpeg 325w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.jpeg?width=650&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.jpeg 650w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.jpeg?width=975&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.jpeg 975w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.jpeg?width=1300&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.jpeg 1300w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.jpeg?width=1625&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.jpeg 1625w, //www.eigoj.com/hs-fs/hubfs/Google%20Drive%20Integration/How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.jpeg?width=1950&name=How%20to%20Code%20a%20Website%20in%206%20Easy%20Steps%20(V7%20-%20CMS%20upload)-3.jpeg 1950w" sizes="(max-width: 650px) 100vw, 650px"></p><h4>关于JavaScript的简短历史课</h4><p>Until now, we've been building a simple website. We are displaying information to our users, but that's the extent of what the site does. At one point, the early internet was the same way. You could access information from various websites, but there wasn't much more a website could do.</p><p>JavaScript was invented in 1995 to add interactivity to web pages. JavaScript is the third foundational language for web development combined with HTML and CSS. Both these languages we've learned so far are markup languages, but JavaScript is a<em>programming</em>语言。编程是计算机根据预定义逻辑执行操作的过程。</p><p>例如,假设用户点击我们的笑脸。然后,网页在注册脸部单击时打印问候。该页面知道这样做,因为我们告诉它要注意这种互动并以特定方式做出反应。</p><h4>Your First JavaScript Program</h4><p>Unfortunately, it is outside of the scope of this lesson to dive into the syntax and mechanics of JavaScript. Instead, I will provide a pre-written program so that we can focus on implementing it within our website.</p><p></p><pre class="syntax"><code class="js"><p></p><p>//识别我们的形象</p><p>const smiley = document.queryselector(“#smiley”);</p><p>// Adding reaction when image is clicked</p><p>smiley.addEventListener("click", () => {</p><p>alert(`Smiley says "Welcome!"`);</p><p>});</p></code><p><code class="js"></code></p></pre><p></p><p>To summarize what's going on, we first tell our program to identify the smiley face HTML element. Then, we attach an event listener that "listens" (looks for) a click from the user on the image. Once that happens, it executes the action we've defined, which is known as the event listener function (or the reaction). In this case, the program prints a welcome message to the screen from our smiley face.</p><p>Now let's see it in action.</p><h4>Adding JavaScript to Your Page</h4><p>将JavaScript添加到我们的页面的主要方法是<strong>script</strong>标签围绕我们的程序。这告诉浏览器我们将JavaScript添加到我们的页面中,因此我们的脚本不会像更多的HTML一样对待。您可以在下面看到这一点。</p><p class="codepen" data-height="615" data-default-tab="html,result" data-slug-hash="xxLMxmE" data-editable="true" data-user="hubspot" style="height: 615px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;"><span>See the Pen<a href="https://codepen.io/hubspot/pen/xxLMxmE">How to Code Website Example: Media Query and Relative Units</a>由HubSpot(<a href="https://codepen.io/hubspot">@hubspot</a>) on<a href="https://codepen.io">CodePen</a>。</span></p><p>这是添加的最佳实践<strong><script></strong>元素<em>after</em>all other content on the page. The easiest way to do this is to add it right before the closing<strong>身体</strong>标签。这将确保我们targetin内容g (the smiley face) will be rendered before our program looks for it. Otherwise, the smiley face would not be found and our program would not work.</p><h2>Next Steps in Building Your Website</h2><p>If you have made it this far, then take a moment to congratulate yourself. You have gone from perhaps never coding before to having the foundation of a website that is both responsive<em>和</em>交互的。我们在HTML和CSS中的不同概念之间涵盖了很多基础,甚至涉及编程。这是您网络开发旅程中的主要第一步。</p><p>当然还有很多要学习的东西。当您继续构建Web开发工具箱时,我概述了一些重点关注的领域。</p><h3>继续学习HTML和CSS。</h3><p>HTML和CSS的复杂性比我们今天所涵盖的更为复杂。这些语言构成了您网站的可见面孔,对用户的体验至关重要。我将基础指南重新链接到下面的HTML和CSS,并添加了一些链接到更高级的CSS主题。</p><p><strong>基础指南:</strong></p> <ul> <li><a rel="noopener" target="_blank" href="//www.eigoj.com/website/html">HTML的最终指南</a>: a one-stop shop for everything you need to know to write HTML like a pro</li> <li><a rel="noopener" target="_blank" href="//www.eigoj.com/website/css-tutorial">CSS的最终指南</a>: a one-stop shop to start using CSS to make your website wow your visitors</li> </ul><p><strong>高级CSS主题:</strong></p> <ul> <li><a rel="noopener" target="_blank" href="//www.eigoj.com/website/css-float">漂浮</a>: a simplified method for arranging HTML elements to the left, right, or center of a page</li> <li><a rel="noopener" target="_blank" href="//www.eigoj.com/website/css-grid">网格</a>: a rigid layout system for arranging content on a page in rows and columns that offers more customization than flexbox</li> <li><a rel="noopener" target="_blank" href="//www.eigoj.com/website/css-grid-vs-flexbox">Flexbox</a>:用于排列内容的流体布局系统<em>或者</em>比格更简单实现的列,但对目录的位置提供了更少的控制权</li> <li><a rel="noopener" target="_blank" href="//www.eigoj.com/website/css-animation">Animations</a>:一种通过对HTML元素进行动画动画元素或视觉效果的动画元素来添加天赋的方法</li> </ul><h3>Learn JavaScript.</h3><p>HTML and CSS<em>slightly</em>由于没有它们,因此重要的是重要的JavaScript,因为没有它们的网页。但是JavaScript本身至关重要。没有它,我们只能查看网站。将没有在线银行业务,社交媒体,食品交付服务以及我们改编互联网以满足我们需求的所有其他方式。JavaScript使我们能够实施编程策略,并在原本静态的站点中添加全新的交互性层。</p><h3>Learn Git and GitHub.</h3><p>Git is the most popular version control system in the industry. Version control enables you to branch your code to test out changes while keeping the original code (AKA source code) unchanged until you confirm your changes are good to deploy. Think of it as making a copy of a Word file so you still have the original content if something goes wrong. As your website grows in complexity, version control will become more and more useful.</p><p><a rel="noopener" target="_blank" href="//www.eigoj.com/website/what-is-github-used-for">GitHub</a>is the most popular code repository built around Git. It allows you to back up your code to a cloud-hosted environment the same way you would back up your photos to iCloud or Google Drive. Git and GitHub are also valuable tools to help you collaborate on your code with others without overwriting each other's work.</p><p>如您所见,您的学习才刚刚开始,但是您现在拥有坚实的基础,可以更好地欣赏即将来临的一切。保持好奇,保持耐心并练习您的编码,您会惊讶于成为完整的网络开发人员的速度。在不到三年的时间里,我从了解基本的HTML到撰写本教程,因此永远不要怀疑自己。我们迫不及待想看看您下一步要做什么。</p><p></p> <div id="slidebox"> <a class="close"></a> <!--HubSpot Call-to-Action Code --> <span class="hs-cta-wrapper" id="hs-cta-wrapper-be00be7b-acfc-4948-9055-bf6bf9746111"><span class="hs-cta-node hs-cta-be00be7b-acfc-4948-9055-bf6bf9746111" id="hs-cta-be00be7b-acfc-4948-9055-bf6bf9746111"> <!--[if lte IE 8]><div id="hs-cta-ie-element"></div><![endif]--><a href="https://cta-redirect.hubspot.com/cta/redirect/53/be00be7b-acfc-4948-9055-bf6bf9746111" target="_blank" rel="noopener"><img class="hs-cta-img" id="hs-cta-img-be00be7b-acfc-4948-9055-bf6bf9746111" style="border-width:0px;" src="https://no-cache.hubspot.com/cta/default/53/be00be7b-acfc-4948-9055-bf6bf9746111.png" alt="css introduction"></a></span></span> <!-- end HubSpot Call-to-Action Code --> </div><p></p><p> <!--HubSpot Call-to-Action Code --><span class="hs-cta-wrapper" id="hs-cta-wrapper-b4b6cb84-2a18-490b-840d-883884a94a83"><span class="hs-cta-node hs-cta-b4b6cb84-2a18-490b-840d-883884a94a83" id="hs-cta-b4b6cb84-2a18-490b-840d-883884a94a83"> <!--[if lte IE 8]><div id="hs-cta-ie-element"></div><![endif]--><a href="https://cta-redirect.hubspot.com/cta/redirect/53/b4b6cb84-2a18-490b-840d-883884a94a83" target="_blank" rel="noopener"><img class="hs-cta-img" id="hs-cta-img-b4b6cb84-2a18-490b-840d-883884a94a83" style="border-width:0px;margin: 0 auto; display: block; margin-top: 20px; margin-bottom: 20px" src="https://no-cache.hubspot.com/cta/default/53/b4b6cb84-2a18-490b-840d-883884a94a83.png" alt="New Call-to-action" align="middle"></a></span></span> <!-- end HubSpot Call-to-Action Code --></p></span> <p class="post-content__publish-date">最初发布于2021年11月29日上午7:00:00,更新于2021年11月29日</p> <div class="post-content__topic-container blog-postPage-topic"> <p>Topics:</p> <a href="//www.eigoj.com/website/website-development" class="post-content__topic" data-hubs_params="false">网站开发</a> </div> <div class="post-content__social-share-container"> <div id="hs_cos_wrapper_End_of_Post_CTA" class="hs_cos_wrapper hs_cos_wrapper_widget hs_cos_wrapper_type_custom_widget" style="" data-hs-cos-general-type="widget" data-hs-cos-type="custom_widget"> <div class="wt-blog__post__cta post-content__bottom-cta"> <div class="wt-blog__post__cta__content"> <h3>别忘了分享这篇文章!</h3> <div class="addthis_inline_share_toolbox"></div> </div> </div> </div> </div> </div> </div> </div> <section class="blog-section-header blog-section-header--border-top blog-section-header--arrow-down "> <h3 class="blog-section-header__heading">相关文章</h3> </section> <section class="related-posts"> <!-- hasFeaturedImage: https://www.hubspot.com/hubfs/phpFrameworks-598x398.jpg --> <article class="blog-card blog-card--one-third "> <figure> <a href="//www.eigoj.com/website/php-framework"><img src="//www.eigoj.com/hubfs/phpFrameworks-598x398.jpg" alt="PHP Framework: What Are They & Why Are They Important?" class="hsg-deferred"></a> </figure> <div class="blog-card__content"> <h3 class="blog-card__content-title"><a href="//www.eigoj.com/website/php-framework">PHP Framework: What Are They & Why Are They Important?</a></h3> <div class="blog-card__meta"> <a href="//www.eigoj.com/website" class="blog-card__blog-link">Website</a> <a href="//www.eigoj.com/website/php-framework" class="blog-card__read-time">|12分钟阅读</a> </div> </div> </article> <!-- hasFeaturedImage: https://www.hubspot.com/hubfs/how-to-create-user-accounts-and-profiles.jpeg --> <article class="blog-card blog-card--one-third "> <figure> <a href="//www.eigoj.com/website/make-website-with-user-accounts"><img src="//www.eigoj.com/hubfs/how-to-create-user-accounts-and-profiles.jpeg" alt="如何使用用户帐户和个人资料制作网站[带有WordPress,Wix等]" class="hsg-deferred"></a> </figure> <div class="blog-card__content"> <h3 class="blog-card__content-title"><a href="//www.eigoj.com/website/make-website-with-user-accounts">如何使用用户帐户和个人资料制作网站[带有WordPress,Wix等]</a></h3> <div class="blog-card__meta"> <a href="//www.eigoj.com/website" class="blog-card__blog-link">Website</a> <a href="//www.eigoj.com/website/make-website-with-user-accounts" class="blog-card__read-time">|10分钟阅读</a> </div> </div> </article> <!-- hasFeaturedImage: https://www.hubspot.com/hubfs/Google%20Drive%20Integration/5%20Award-Winning%20Websites%20and%20What%20You%20Can%20Learn%20From%20Them-1.jpeg --> <article class="blog-card blog-card--one-third "> <figure> <a href="//www.eigoj.com/website/award-winning-websites"><img src="//www.eigoj.com/hubfs/Google%20Drive%20Integration/5%20Award-Winning%20Websites%20and%20What%20You%20Can%20Learn%20From%20Them-1.jpeg" alt="5个获奖网站以及您可以从中学到什么" class="hsg-deferred"></a> </figure> <div class="blog-card__content"> <h3 class="blog-card__content-title"><a href="//www.eigoj.com/website/award-winning-websites">5个获奖网站以及您可以从中学到什么</a></h3> <div class="blog-card__meta"> <a href="//www.eigoj.com/website" class="blog-card__blog-link">Website</a> <a href="//www.eigoj.com/website/award-winning-websites" class="blog-card__read-time">|10分钟阅读</a> </div> </div> </article> </section> <div id="hs_cos_wrapper_module_163294726013371" class="hs_cos_wrapper hs_cos_wrapper_widget hs_cos_wrapper_type_module" style="" data-hs-cos-general-type="widget" data-hs-cos-type="module"></div> </main> </main> <div class="blog-sticky-footer open hide" data-background="gradient4"> <div class="hs-page-width-normal"> <div class="blog-sticky-footer__container" data-timeout="3000"> <div class="blog-sticky-footer__interactor"></div> <div class="blog-sticky-footer__collapsed-content hidden-content"> <p><strong>扩展优惠</strong></p> </div> <div class="blog-sticky-footer__open-content visible-content"> <p><strong>Sign up for HubSpot's CMS Software</strong></p> <a href="https://www.hubspot.com/products/cms?hubs_post-cta=mobile-blog-sticky" class="cta cta--medium cta--primary blog-sticky-update">现在就得到</a> <button class="cta cta--medium cta--primary blog-sticky-update">现在就得到</button> </div> </div> </div> </div> <div id="blog-sticky-footer-form" class="blog-sticky-footer-form blog-sticky-footer-form--hidden"> <div class="blog-sticky-footer-form__container"> <div class="blog-sticky-footer-form__content"> <span class="blog-sticky-footer-form__close hsg-icon hsg-icon-close"></span> <div class="blog-sticky-footer-form__header"> <span class="blog-sticky-footer-form__header-pre-title"></span> <h2 class="blog-sticky-footer-form__header-title"></h2> <div class="blog-sticky-footer-form__header-content"> <div class="blog-sticky-footer-form__header-img"> <img src="" alt=""> </div> <div> <p class="blog-sticky-footer-form__header-description"></p> <div class="blog-sticky-footer-form__header-external-link-wrapper"> <a class="blog-sticky-footer-form__header-external-link" href="" target="_blank"><span></span> <svg class="cl-icon"> <use xlink:href="#external-link"></use> </svg></a> </div> </div> </div> </div> <div class="blog-sticky-footer-form__form-wrapper"> <span id="hs_cos_wrapper_blog_sticky_footer_form" class="hs_cos_wrapper hs_cos_wrapper_widget hs_cos_wrapper_type_form" style="" data-hs-cos-general-type="widget" data-hs-cos-type="form"><h3 id="hs_cos_wrapper_blog_sticky_footer_form_title" class="hs_cos_wrapper form-title" data-hs-cos-general-type="widget_field" data-hs-cos-type="text"></h3> <div id="hs_form_target_blog_sticky_footer_form"></div></span> </div> </div> </div> </div> </section> </div> <div data-modal="downloadForLater" data-exit="0" class="hsg-modal-container"> <div class="hsg-modal-contents"> <div data-background="secondary4" class="hsg-modal-header"> <span class="hsg-icon hsg-icon-close"></span> </div> <div class="hsg-modal-text" style="text-align: left"> <span id="hs_cos_wrapper_download_for_later" class="hs_cos_wrapper hs_cos_wrapper_widget hs_cos_wrapper_type_form" style="" data-hs-cos-general-type="widget" data-hs-cos-type="form"><h3 id="hs_cos_wrapper_download_for_later_title" class="hs_cos_wrapper form-title" data-hs-cos-general-type="widget_field" data-hs-cos-type="text">下载以后</h3> <div id="hs_form_target_download_for_later"></div></span> </div> </div> </div> </main> </div> </div> </div> </div> <div class="footer-container-wrapper"> <div class="footer-container container-fluid"> <div class="row-fluid-wrapper row-depth-1 row-number-1"> <div class="row-fluid "> <div class="span12 widget-span widget-type-global_group " style="" data-widget-type="global_group" data-x="0" data-w="12"> <div class="" data-global-widget-path="generated_global_groups/4255443445.html"> <div class="row-fluid-wrapper row-depth-1 row-number-1 "> <div class="row-fluid "> <div class="span12 widget-span widget-type-raw_jinja " style="" data-widget-type="raw_jinja" data-x="0" data-w="12"> <footer class="hsg-footer"> <div class="hsg-footer__layout"> <div id="back-link" class="hsg-footer__logo-caret"> <a class="hsg-footer__logo-caret-home" href="#">BACK</a> <span class="hsg-footer__close" role="img" aria-label="Close"></span> </div> <nav class="hsg-footer__nav"> <div class="hsg-footer__nav-left" role="navigation"> <section class="hsg-footer__nav-column hsg-footer__nav-column-left"> <input type="checkbox" id="hsg-footer-column-0" name="hsg-footer-column-0"> <label for="hsg-footer-column-0">流行功能</label> <ul> <li class="hsg-footer__nav-item" data-order="0"><a href="https://www.hubspot.com/products/sales/schedule-meeting" data-order="0" data-linkorder="0">Free Meeting Scheduler App</a></li> <li class="hsg-footer__nav-item" data-order="1"><a href="https://www.hubspot.com/products/marketing/social-inbox" data-order="1" data-linkorder="1">社交媒体工具</a></li> <li class="hsg-footer__nav-item" data-order="2"><a href="https://www.hubspot.com/products/sales/email-tracking" data-order="2" data-linkorder="2">Email Tracking Software</a></li> <li class="hsg-footer__nav-item" data-order="3"><a href="https://www.hubspot.com/products/sales/sales-automation" data-order="3" data-linkorder="3">销售电子邮件自动化</a></li> <li class="hsg-footer__nav-item" data-order="4"><a href="https://www.hubspot.com/products/marketing/ads" data-order="4" data-linkorder="4">广告软件bob电竞官方下载</a></li> <li class="hsg-footer__nav-item" data-order="5"><a href="https://www.hubspot.com/products/marketing/email" data-order="5" data-linkorder="5">Email Marketing Software</a></li> <li class="hsg-footer__nav-item" data-order="6"><a href="https://www.hubspot.com/products/crm/lead-management" data-order="6" data-linkorder="6">潜在客户管理软件bob电竞官方下载</a></li> <li class="hsg-footer__nav-item" data-order="7"><a href="https://www.hubspot.com/products/crm/pipeline-management" data-order="7" data-linkorder="7">Pipeline Management Tools</a></li> <li class="hsg-footer__nav-item" data-order="8"><a href="https://www.hubspot.com/products/sales/email-templates-sales" data-order="8" data-linkorder="8">Sales Email Templates</a></li> <li class="hsg-footer__nav-item" data-order="9"><a href="https://www.hubspot.com/products/service/help-desk" data-order="9" data-linkorder="9">帮助台软件bob电竞官方下载</a></li> <li class="hsg-footer__nav-item" data-order="10"><a href="https://www.hubspot.com/products/marketing/forms" data-order="10" data-linkorder="10">免费的在线表格建造者</a></li> <li class="hsg-footer__nav-item" data-order="11"><a href="https://www.hubspot.com/products/crm/chatbot-builder" data-order="11" data-linkorder="11">免费聊天机器人建造者</a></li> <li class="hsg-footer__nav-item" data-order="12"><a href="https://www.hubspot.com/products/crm/live-chat" data-order="12" data-linkorder="12">免费实时聊天软件bob电竞官方下载</a></li> <li class="hsg-footer__nav-item" data-order="13"><a href="https://www.hubspot.com/products/marketing/analytics" data-order="13" data-linkorder="13">营销Analytics</a></li> <li class="hsg-footer__nav-item" data-order="14"><a href="https://www.hubspot.com/products/marketing/landing-pages" data-order="14" data-linkorder="14">免费着陆页构建器</a></li> </ul> </section> </div> <div class="hsg-footer__nav-right" role="navigation"> <div class="hsg-footer__nav-full" role="navigation"> <section class="hsg-footer__nav-column "> <input type="checkbox" id="hsg-footer-column-1" name="hsg-footer-column-1"> <label for="hsg-footer-column-1">Free Tools</label> <ul> <li class="hsg-footer__nav-item" data-order="0"><a href="https://website.grader.com/?__hstc=20629287.e4e046660731447bf82affe18aa75831.1482962870986.1487962165415.1487964870240.141&__hssc=20629287.1.1487964870240&__hsfp=3218882972" data-order="0" data-linkorder="0">Website Grader</a></li> <li class="hsg-footer__nav-item" data-order="1"><a href="https://www.hubspot.com/make-my-persona" data-order="1" data-linkorder="1">做我的角色</a></li> <li class="hsg-footer__nav-item" data-order="2"><a href="https://www.hubspot.com/email-signature-generator" data-order="2" data-linkorder="2">Email Signature Generator</a></li> <li class="hsg-footer__nav-item" data-order="3"><a href="https://www.hubspot.com/blog-topic-generator" data-order="3" data-linkorder="3">Blog Ideas Generator</a></li> <li class="hsg-footer__nav-item" data-order="4"><a href="https://www.hubspot.com/invoice-template-generator" data-order="4" data-linkorder="4">发票模板生成器</a></li> <li class="hsg-footer__nav-item" data-order="5"><a href="https://www.hubspot.com/marketing-plan-template-generator" data-order="5" data-linkorder="5">营销计划生成器</a></li> <li class="hsg-footer__nav-item" data-order="6"><a href="https://www.hubspot.com/business-templates" data-order="6" data-linkorder="6">免费的业务模板</a></li> <li class="hsg-footer__nav-item" data-order="7"><a href="https://www.hubspot.com/industry-data" data-order="7" data-linkorder="7">行业基准数据</a></li> <li class="hsg-footer__nav-item" data-order="8"><a href="https://www.hubspot.com/comparisons" data-order="8" data-linkorder="8">Software Comparisons Library</a></li> </ul> </section> </div> <div class="hsg-footer__nav-full" role="navigation"> <section class="hsg-footer__nav-column "> <input type="checkbox" id="hsg-footer-column-2" name="hsg-footer-column-2"> <label for="hsg-footer-column-2">bob全站app</label> <ul> <li class="hsg-footer__nav-item" data-order="0"><a href="https://www.hubspot.com/our-story" data-order="0" data-linkorder="0">About Us</a></li> <li class="hsg-footer__nav-item" data-order="1"><a href="https://www.hubspot.com/careers" data-order="1" data-linkorder="1">Careers</a></li> <li class="hsg-footer__nav-item" data-order="2"><a href="https://www.hubspot.com/company/management" data-order="2" data-linkorder="2">Management Team</a></li> <li class="hsg-footer__nav-item" data-order="3"><a href="https://www.hubspot.com/company/board-of-directors" data-order="3" data-linkorder="3">Board of Directors</a></li> <li class="hsg-footer__nav-item" data-order="4"><a href="https://ir.hubspot.com/?_ga=2.262843276.12874469.1592422655-430007000.1592422655" data-order="4" data-linkorder="4">Investor Relations</a></li> <li class="hsg-footer__nav-item" data-order="5"><a href="//www.eigoj.com" data-order="5" data-linkorder="5">Blog</a></li> <li class="hsg-footer__nav-item" data-order="6"><a href="https://www.hubspot.com/company/contact" data-order="6" data-linkorder="6">联系我们</a></li> </ul> </section> </div> <div class="hsg-footer__nav-split" role="navigation"> <section class="hsg-footer__nav-column "> <input type="checkbox" id="hsg-footer-column-3" name="hsg-footer-column-3"> <label for="hsg-footer-column-3">Customers</label> <ul> <li class="hsg-footer__nav-item" data-order="0"><a href="https://help.hubspot.com/" data-order="0" data-linkorder="0">客户支持</a></li> <li class="hsg-footer__nav-item" data-order="1"><a href="https://academy.hubspot.com/hubspot-user-groups" data-order="1" data-linkorder="1">加入本地用户组</a></li> </ul> </section> <section class="hsg-footer__nav-column "> <input type="checkbox" id="hsg-footer-column-4" name="hsg-footer-column-4"> <label for="hsg-footer-column-4">bob综合博彩下载</label> <ul> <li class="hsg-footer__nav-item" data-order="0"><a href="https://www.hubspot.com/partners" data-order="0" data-linkorder="0">所有合作伙伴计划</a></li> <li class="hsg-footer__nav-item" data-order="1"><a href="https://www.hubspot.com/partners/solutions" data-order="1" data-linkorder="1">Solutions Partner Program</a></li> <li class="hsg-footer__nav-item" data-order="2"><a href="https://www.hubspot.com/partners/app" data-order="2" data-linkorder="2">应用程序合作伙伴计划</a></li> <li class="hsg-footer__nav-item" data-order="3"><a href="https://www.hubspot.com/startups/partners" data-order="3" data-linkorder="3">HubSpot for Startups</a></li> <li class="hsg-footer__nav-item" data-order="4"><a href="https://www.hubspot.com/partners/affiliates" data-order="4" data-linkorder="4">会员计划</a></li> </ul> </section> </div> </div> </nav> </div> <section class="hsg-footer__contact-links"> <ul class="hsg-footer__social"> <li><a href="https://www.facebook.com/hubspot" target="_blank" class="hstc_facebook"><i class="hsg-icon hsg-icon-facebook"></i><span class="hidden-social">Facebook</span></a></li> <li><a href="https://www.instagram.com/hubspot" target="_blank" class="hstc_instagram"><i class="hsg-icon hsg-icon-instagram"></i><span class="hidden-social">Instagram</span></a></li> <li><a href="https://youtube.com/user/HubSpot" target="_blank" class="hstc_youtube"><i class="hsg-icon hsg-icon-youtube"></i><span class="hidden-social">YouTube</span></a></li> <li><a href="https://twitter.com/HubSpot" target="_blank" class="hstc_twitter"><i class="hsg-icon hsg-icon-twitter"></i><span class="hidden-social">推特</span></a></li> <li><a href="https://www.linkedin.com/company/hubspot" target="_blank" class="hstc_linkedin"><i class="hsg-icon hsg-icon-linkedin"></i><span class="hidden-social">LinkedIn</span></a></li> <li><a href="https://medium.com/@HubSpot" target="_blank" class="hstc_medium"><i class="hsg-icon hsg-icon-medium"></i><span class="hidden-social">中等的</span></a></li> </ul> </section> <section class="hsg-footer__bottom"> <div class="hsg-footer__apps"> <a class="hsg-footer__app" href="https://apps.apple.com/us/app/hubspot/id1107711722" aria-label="Link to App Store"><img class="hsg-deferred homepage-mobile-footer-apple" data-src="https://cdn2.hubspot.net/hubfs/53/app%20store%20high%20res.png" alt="App store"></a> <a class="hsg-footer__app" href="https://play.google.com/store/apps/details?id=com.hubspot.android&hl=en_US" aria-label="Link to Google Play"><img class="hsg-deferred homepage-mobile-footer-google" data-src="https://cdn2.hubspot.net/hubfs/53/google%20play%20high%20res.png" alt="Google Play"></a> </div> <div class="hsg-footer__logo" role="img"> <a href="https://www.hubspot.com" aria-label="HubSpot Home Logo"><img class="hsg-deferred" data-src="https://www.hubspot.com/hubfs/WBZ-1165%20Global%20Nav%20Redesign/Wordmark-White.svg" alt="HubSpot徽标"></a> <p>Copyright © 2021 HubSpot, Inc.</p> </div> <div class="hsg-footer__copyright"> <ul> <li><a href="https://legal.hubspot.com/legal-stuff">Legal Stuff</a></li> <li><a href="https://legal.hubspot.com/privacy-policy">隐私政策</a></li> </ul> </div> </section> </footer> </div> </div> <!--end widget-span --> </div> <!--end row--> </div> <!--end row-wrapper --> </div> </div> <!--end widget-span --> </div> <!--end row--> </div> <!--end row-wrapper --> <div class="row-fluid-wrapper row-depth-1 row-number-2"> <div class="row-fluid "> <div class="span12 widget-span widget-type-raw_html " style="" data-widget-type="raw_html" data-x="0" data-w="12"> <div class="cell-wrapper layout-widget-wrapper"> <span id="hs_cos_wrapper_module_1497301113455132" class="hs_cos_wrapper hs_cos_wrapper_widget hs_cos_wrapper_type_raw_html" style="" data-hs-cos-general-type="widget" data-hs-cos-type="raw_html"> <!-- prev 4208 --></span> </div> <!--end layout-widget-wrapper --> </div> <!--end widget-span --> </div> <!--end row--> </div> <!--end row-wrapper --> </div> <!--end footer --> <!--end footer wrapper --> <!--[if lte IE 8]> <script charset="utf-8" src="https://js.hsforms.net/forms/v2-legacy.js"></script> <![endif]--> <!-- Start of HubSpot Analytics Code --> <!-- End of HubSpot Analytics Code --> <!-- HREFLANG MACRO --> <!-- begin Convert --> <!-- end Convert --> <!-- wt-mktg-analytics script --> <div id="fb-root"></div> </body> </html>