找到 10435 篇文章 关于 Web 开发

为什么我们在 HTML 页面中使用 head 标签?

Lokesh Badavath
更新于 2022年11月11日 08:15:36

2K+ 次浏览

`` 标签是 HTML 页面中所有头部元素的容器。我们使用 … 标签将其添加到 HTML 页面中。`` 标签包含文档标题、样式、脚本和其他 HTML 元素。`` 元素是元数据(关于数据的数据)的容器,位于 … 标签之间。以下元素可以放在 `` 元素内: - ``:用于定义内容的标题,每个 HTML 页面都应使用。 - `<style>`:用于向 HTML 文档应用简单的样式。- `<base>`:指定默认 URL 和默认… <a href="https://tutorialspoint.com/Why-do-we-use-head-tag-in-HTML-Page"><span class="read_more">阅读更多 <i class="fal fa-long-arrow-right"></i></span></a></p> </div> </div> </div> <div class="clear"></div> <div class="question_section"> <div class="google_content_ads"> <div style="text-align: center;"> <div id="ezoic-pub-ad-placeholder-133"></div> <script> ezstandalone.cmd.push(function() { ezstandalone.showAds(133); }); </script> </div> </div> </div> <div class="question_section"> <div class="qa_widget"> <div class="qa_post qa_list"> <h3> <a href="https://tutorialspoint.com/How-to-Insert-Hyperlink-in-HTML-Page" target="_blank">如何在 HTML 页面中插入超链接?</a> </h3> <div class="qa_category" id="tags_2930"> <a href="https://tutorialspoint.com/articles/category/HTML" target="_blank"><span>HTML</span></a><a href="https://tutorialspoint.com/articles/category/Web-Development" target="_blank"><span>Web 开发</span></a><a href="https://tutorialspoint.com/articles/category/Front-End-Technology" target="_blank"><span>前端技术</span></a></div> </div> <div class="qa_answer_widget"> <a href="https://tutorialspoint.com/authors/bhanu-priya" title="Bhanu Priya"><img src="https://tutorialspoint.com/assets/profiles/314653/profile/60_78287-1615027882.jpg" alt="Bhanu Priya"></a> <div class="qa_answer_detail"> <a href="https://tutorialspoint.com/authors/bhanu-priya" title="Bhanu Priya">Bhanu Priya</a> </div> <div class="flex-group"> <div class="qa_answer_dtm">更新于 2023年10月05日 12:18:46</div> <p class="views-count" title="Article Views"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512"><path d="M117.2 136C160.3 96 217.6 64 288 64s127.7 32 170.8 72c43.1 40 71.9 88 85.2 120c-13.3 32-42.1 80-85.2 120c-43.1 40-100.4 72-170.8 72s-127.7-32-170.8-72C74.1 336 45.3 288 32 256c13.3-32 42.1-80 85.2-120zM288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM192 256a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zm224 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z"></path></svg>161K+ 次浏览</p> </div> <div class="clear"></div> <p>要在 HTML 页面中插入超链接,我们必须使用锚点标签和标签,用于定义链接。`<a>` 标签表示超链接的开始,`</a>` 标签表示超链接的结束。这两个标签之间的任何文本都将作为超链接。在 `<a>` 标签中添加链接的 URL。以下是超链接的用法:`<html>`… --文本 `</a>` 在 HTML 中,… <a href="https://tutorialspoint.com/How-to-Insert-Hyperlink-in-HTML-Page"><span class="read_more">阅读更多 <i class="fal fa-long-arrow-right"></i></span></a></p> </div> </div> </div> <div class="clear"></div> <div class="question_section"> <div class="qa_widget"> <div class="qa_post qa_list"> <h3> <a href="https://tutorialspoint.com/How-to-use-image-height-and-width-attribute-in-HTML-Page" target="_blank">如何在 HTML 页面中使用图片的高度和宽度属性?</a> </h3> <div class="qa_category" id="tags_2929"> <a href="https://tutorialspoint.com/articles/category/HTML" target="_blank"><span>HTML</span></a><a href="https://tutorialspoint.com/articles/category/Web-Development" target="_blank"><span>Web 开发</span></a><a href="https://tutorialspoint.com/articles/category/Front-End-Technology" target="_blank"><span>前端技术</span></a></div> </div> <div class="qa_answer_widget"> <a href="https://tutorialspoint.com/authors/lokesh-badavath" title="Lokesh Badavath"><img src="https://tutorialspoint.com/assets/profiles/538106/profile/60_1039031-1666073315.jpg" alt="Lokesh Badavath"></a> <div class="qa_answer_detail"> <a href="https://tutorialspoint.com/authors/lokesh-badavath" title="Lokesh Badavath">Lokesh Badavath</a> </div> <div class="flex-group"> <div class="qa_answer_dtm">更新于 2022年11月11日 08:13:37</div> <p class="views-count" title="Article Views"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512"><path d="M117.2 136C160.3 96 217.6 64 288 64s127.7 32 170.8 72c43.1 40 71.9 88 85.2 120c-13.3 32-42.1 80-85.2 120c-43.1 40-100.4 72-170.8 72s-127.7-32-170.8-72C74.1 336 45.3 288 32 256c13.3-32 42.1-80 85.2-120zM288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM192 256a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zm224 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z"></path></svg>2K+ 次浏览</p> </div> <div class="clear"></div> <p>图片使内容更有趣,帮助读者更好地理解网页上的内容。我们可以将图片插入到 HTML 页面中。要在 HTML 页面中插入图片,请使用 `<img>` 标签。这是一个空标签,只包含属性,因为不需要结束标签。`src` 属性用于添加图片源(文件的 URL)。`alt` 属性用于添加替代文本,`width` 用于添加宽度,`height` 用于添加图片的高度。我们使用 `style` 属性来… <a href="https://tutorialspoint.com/How-to-use-image-height-and-width-attribute-in-HTML-Page"><span class="read_more">阅读更多 <i class="fal fa-long-arrow-right"></i></span></a></p> </div> </div> </div> <div class="clear"></div> <div class="question_section"> <div class="qa_widget"> <div class="qa_post qa_list"> <h3> <a href="https://tutorialspoint.com/How-to-use-href-attribute-in-HTML-Page" target="_blank">如何在 HTML 页面中使用 href 属性?</a> </h3> <div class="qa_category" id="tags_2928"> <a href="https://tutorialspoint.com/articles/category/HTML" target="_blank"><span>HTML</span></a><a href="https://tutorialspoint.com/articles/category/Web-Development" target="_blank"><span>Web 开发</span></a><a href="https://tutorialspoint.com/articles/category/Front-End-Technology" target="_blank"><span>前端技术</span></a></div> </div> <div class="qa_answer_widget"> <a href="https://tutorialspoint.com/authors/lokesh-badavath" title="Lokesh Badavath"><img src="https://tutorialspoint.com/assets/profiles/538106/profile/60_1039031-1666073315.jpg" alt="Lokesh Badavath"></a> <div class="qa_answer_detail"> <a href="https://tutorialspoint.com/authors/lokesh-badavath" title="Lokesh Badavath">Lokesh Badavath</a> </div> <div class="flex-group"> <div class="qa_answer_dtm">更新于 2022年11月11日 08:11:28</div> <p class="views-count" title="Article Views"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512"><path d="M117.2 136C160.3 96 217.6 64 288 64s127.7 32 170.8 72c43.1 40 71.9 88 85.2 120c-13.3 32-42.1 80-85.2 120c-43.1 40-100.4 72-170.8 72s-127.7-32-170.8-72C74.1 336 45.3 288 32 256c13.3-32 42.1-80 85.2-120zM288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM192 256a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zm224 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z"></path></svg>2K+ 次浏览</p> </div> <div class="clear"></div> <p>`href` 属性指定链接指向的页面的 URL(`href` 属性指定链接的目标)。我们应该将 `href` 属性与 `<a>` 标签一起使用,这样它将成为一个超链接。此标签应在 … 标签内使用。语法以下是使用 `href` 属性指定链接地址的 `<a>` 标签的语法。链接文本示例以下是如何在 HTML 页面中使用 `href` 属性的示例程序。`<!DOCTYPE html>` 点击这里导航到 Brave 首页 如何… <a href="https://tutorialspoint.com/How-to-use-href-attribute-in-HTML-Page"><span class="read_more">阅读更多 <i class="fal fa-long-arrow-right"></i></span></a></p> </div> </div> </div> <div class="clear"></div> <div class="question_section"> <div class="qa_widget"> <div class="qa_post qa_list"> <h3> <a href="https://tutorialspoint.com/What-is-horizontal-rule-in-HTML-Page" target="_blank">HTML 页面中的水平线是什么?</a> </h3> <div class="qa_category" id="tags_2927"> <a href="https://tutorialspoint.com/articles/category/HTML" target="_blank"><span>HTML</span></a><a href="https://tutorialspoint.com/articles/category/Web-Development" target="_blank"><span>Web 开发</span></a><a href="https://tutorialspoint.com/articles/category/Front-End-Technology" target="_blank"><span>前端技术</span></a></div> </div> <div class="qa_answer_widget"> <a href="https://tutorialspoint.com/authors/lokesh-badavath" title="Lokesh Badavath"><img src="https://tutorialspoint.com/assets/profiles/538106/profile/60_1039031-1666073315.jpg" alt="Lokesh Badavath"></a> <div class="qa_answer_detail"> <a href="https://tutorialspoint.com/authors/lokesh-badavath" title="Lokesh Badavath">Lokesh Badavath</a> </div> <div class="flex-group"> <div class="qa_answer_dtm">更新于 2023年11月21日 21:06:13</div> <p class="views-count" title="Article Views"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512"><path d="M117.2 136C160.3 96 217.6 64 288 64s127.7 32 170.8 72c43.1 40 71.9 88 85.2 120c-13.3 32-42.1 80-85.2 120c-43.1 40-100.4 72-170.8 72s-127.7-32-170.8-72C74.1 336 45.3 288 32 256c13.3-32 42.1-80 85.2-120zM288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM192 256a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zm224 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z"></path></svg>1K+ 次浏览</p> </div> <div class="clear"></div> <p>`<hr>` 标签定义了 HTML 页面中的一个分割线,或用于使用水平线分隔 HTML 页面中的内容,通常显示为水平线。`<hr>` 标签在 HTML 页面中定义带有水平线的分割线。`<hr>` 标签是一个空元素。它只有一个开始标签,即 `<hr>`。语法以下是 `<hr>` 标签的语法。… 示例以下是示例程序,它使用 `<hr>` 标签分隔网页上的内容。`<!DOCTYPE html>` 人民代表大会… <a href="https://tutorialspoint.com/What-is-horizontal-rule-in-HTML-Page"><span class="read_more">阅读更多 <i class="fal fa-long-arrow-right"></i></span></a></p> </div> </div> </div> <div class="clear"></div> <div class="question_section"> <div class="qa_widget"> <div class="qa_post qa_list"> <h3> <a href="https://tutorialspoint.com/How-to-Insert-an-Image-in-HTML-Page" target="_blank">如何在 HTML 页面中插入图片?</a> </h3> <div class="qa_category" id="tags_2925"> <a href="https://tutorialspoint.com/articles/category/HTML" target="_blank"><span>HTML</span></a><a href="https://tutorialspoint.com/articles/category/Web-Development" target="_blank"><span>Web 开发</span></a><a href="https://tutorialspoint.com/articles/category/Front-End-Technology" target="_blank"><span>前端技术</span></a></div> </div> <div class="qa_answer_widget"> <a href="https://tutorialspoint.com/authors/lokesh-badavath" title="Lokesh Badavath"><img src="https://tutorialspoint.com/assets/profiles/538106/profile/60_1039031-1666073315.jpg" alt="Lokesh Badavath"></a> <div class="qa_answer_detail"> <a href="https://tutorialspoint.com/authors/lokesh-badavath" title="Lokesh Badavath">Lokesh Badavath</a> </div> <div class="flex-group"> <div class="qa_answer_dtm">更新于 2024年10月21日 14:57:03</div> <p class="views-count" title="Article Views"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512"><path d="M117.2 136C160.3 96 217.6 64 288 64s127.7 32 170.8 72c43.1 40 71.9 88 85.2 120c-13.3 32-42.1 80-85.2 120c-43.1 40-100.4 72-170.8 72s-127.7-32-170.8-72C74.1 336 45.3 288 32 256c13.3-32 42.1-80 85.2-120zM288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM192 256a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zm224 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z"></path></svg>93K+ 次浏览</p> </div> <div class="clear"></div> <p>在 HTML 页面中插入图片是一项非常常见且简单的任务,可以增强任何网页的外观。它使网页看起来更具吸引力。在这篇文章中,我们的任务是在 HTML 页面中插入图片。我们使用了三种不同的方法,使用 HTML 标签和 CSS 属性在 HTML 页面中插入图片。在 HTML 页面中插入图片的方法以下是我们在本文中将逐步讲解并提供完整示例代码的在 HTML 页面中插入图片的方法。… <a href="https://tutorialspoint.com/How-to-Insert-an-Image-in-HTML-Page"><span class="read_more">阅读更多 <i class="fal fa-long-arrow-right"></i></span></a></p> </div> </div> </div> <div class="clear"></div> <div class="question_section"> <div class="google_content_ads"> <div style="text-align: center;"> <div id="ezoic-pub-ad-placeholder-134"></div> <script> ezstandalone.cmd.push(function() { ezstandalone.showAds(134); }); </script> </div> </div> </div> <div class="question_section"> <div class="qa_widget"> <div class="qa_post qa_list"> <h3> <a href="https://tutorialspoint.com/How-to-create-a-dialog-with-yes-and-no-options-in-JavaScript" target="_blank">如何在 JavaScript 中创建一个带有“是”和“否”选项的对话框?</a> </h3> <div class="qa_category" id="tags_2924"> <a href="https://tutorialspoint.com/articles/category/Javascript" target="_blank"><span>Javascript</span></a><a href="https://tutorialspoint.com/articles/category/Web-Development" target="_blank"><span>Web 开发</span></a><a href="https://tutorialspoint.com/articles/category/Front-End-Technology" target="_blank"><span>前端技术</span></a></div> </div> <div class="qa_answer_widget"> <a href="https://tutorialspoint.com/authors/Anvi-Jain" title="Anvi Jain"><img src="https://tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg" alt="Anvi Jain"></a> <div class="qa_answer_detail"> <a href="https://tutorialspoint.com/authors/Anvi-Jain" title="Anvi Jain">Anvi Jain</a> </div> <div class="flex-group"> <div class="qa_answer_dtm">更新于 2019年7月30日 22:30:21</div> <p class="views-count" title="Article Views"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512"><path d="M117.2 136C160.3 96 217.6 64 288 64s127.7 32 170.8 72c43.1 40 71.9 88 85.2 120c-13.3 32-42.1 80-85.2 120c-43.1 40-100.4 72-170.8 72s-127.7-32-170.8-72C74.1 336 45.3 288 32 256c13.3-32 42.1-80 85.2-120zM288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM192 256a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zm224 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z"></path></svg>3K+ 次浏览</p> </div> <div class="clear"></div> <p>不,你不能创建一个带有“是”或“否”按钮的对话框。JavaScript 中的确认对话框带有“确定”和“取消”按钮。要创建一个带有“是”或“否”按钮的对话框,请使用自定义对话框。示例实时演示                           function functionConfirm(msg, myYes, myNo) {             var confirmBox = $("#confirm");             confirmBox.find(".message").text(msg);             confirmBox.find(".yes, .no").unbind().click(function() {                confirmBox.hide();             });         … <a href="https://tutorialspoint.com/How-to-create-a-dialog-with-yes-and-no-options-in-JavaScript"><span class="read_more">阅读更多 <i class="fal fa-long-arrow-right"></i></span></a></p> </div> </div> </div> <div class="clear"></div> <div class="question_section"> <div class="qa_widget"> <div class="qa_post qa_list"> <h3> <a href="https://tutorialspoint.com/How-to-make-page-links-in-HTML-Page" target="_blank">如何在 HTML 页面中创建页面链接?</a> </h3> <div class="qa_category" id="tags_2923"> <a href="https://tutorialspoint.com/articles/category/HTML" target="_blank"><span>HTML</span></a><a href="https://tutorialspoint.com/articles/category/Web-Development" target="_blank"><span>Web 开发</span></a><a href="https://tutorialspoint.com/articles/category/Front-End-Technology" target="_blank"><span>前端技术</span></a></div> </div> <div class="qa_answer_widget"> <a href="https://tutorialspoint.com/authors/lokesh-badavath" title="Lokesh Badavath"><img src="https://tutorialspoint.com/assets/profiles/538106/profile/60_1039031-1666073315.jpg" alt="Lokesh Badavath"></a> <div class="qa_answer_detail"> <a href="https://tutorialspoint.com/authors/lokesh-badavath" title="Lokesh Badavath">Lokesh Badavath</a> </div> <div class="flex-group"> <div class="qa_answer_dtm">更新于 2023年9月1日 02:14:02</div> <p class="views-count" title="Article Views"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512"><path d="M117.2 136C160.3 96 217.6 64 288 64s127.7 32 170.8 72c43.1 40 71.9 88 85.2 120c-13.3 32-42.1 80-85.2 120c-43.1 40-100.4 72-170.8 72s-127.7-32-170.8-72C74.1 336 45.3 288 32 256c13.3-32 42.1-80 85.2-120zM288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM192 256a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zm224 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z"></path></svg>83K+ 次浏览</p> </div> <div class="clear"></div> <p>链接是从一个网页到另一个网页的连接。我们可以向网页添加页面链接。HTML 链接是超链接。`<a>` 标签定义了一个超链接,用于在一个页面之间创建链接。`href` 属性与 `<a>` 标签一起使用,指示链接的目标。要在 HTML 页面中创建页面链接,我们需要使用 `<a>` 标签的 `href` 属性。确保 `<a>` 标签放在 … 标签内。链接文本是可见的。点击链接文本将… <a href="https://tutorialspoint.com/How-to-make-page-links-in-HTML-Page"><span class="read_more">阅读更多 <i class="fal fa-long-arrow-right"></i></span></a></p> </div> </div> </div> <div class="clear"></div> <div class="question_section"> <div class="qa_widget"> <div class="qa_post qa_list"> <h3> <a href="https://tutorialspoint.com/How-to-change-button-label-in-alert-box-using-JavaScript" target="_blank">如何使用 JavaScript 更改警告框中的按钮标签?</a> </h3> <div class="qa_category" id="tags_2922"> <a href="https://tutorialspoint.com/articles/category/Front-End-Technology" target="_blank"><span>前端技术</span></a><a href="https://tutorialspoint.com/articles/category/Javascript" target="_blank"><span>Javascript</span></a><a href="https://tutorialspoint.com/articles/category/Web-Development" target="_blank"><span>Web 开发</span></a></div> </div> <div class="qa_answer_widget"> <a href="https://tutorialspoint.com/authors/shubham-vora" title="Shubham Vora"><img src="https://tutorialspoint.com/assets/profiles/485898/profile/60_1456867-1657516792.jpeg" alt="Shubham Vora"></a> <div class="qa_answer_detail"> <a href="https://tutorialspoint.com/authors/shubham-vora" title="Shubham Vora">Shubham Vora</a> </div> <div class="flex-group"> <div class="qa_answer_dtm">更新于 2022年8月2日 13:46:21</div> <p class="views-count" title="Article Views"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512"><path d="M117.2 136C160.3 96 217.6 64 288 64s127.7 32 170.8 72c43.1 40 71.9 88 85.2 120c-13.3 32-42.1 80-85.2 120c-43.1 40-100.4 72-170.8 72s-127.7-32-170.8-72C74.1 336 45.3 288 32 256c13.3-32 42.1-80 85.2-120zM288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM192 256a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zm224 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z"></path></svg>4K+ 次浏览</p> </div> <div class="clear"></div> <p>在本教程中,我们将学习如何使用 JavaScript 更改警告框中的按钮标签。警告框是一种弹出框,用于向用户显示一些重要信息。我们可以使用 JavaScript 的 `alert()` 方法弹出警告框。默认的警告框包含简单的消息和“确定”按钮,它会出现在浏览器屏幕的顶部中央。只有消息且没有任何样式的默认警告框看起来很奇怪。因此,我们需要使其更具样式,并更改按钮和标签的样式… <a href="https://tutorialspoint.com/How-to-change-button-label-in-alert-box-using-JavaScript"><span class="read_more">阅读更多 <i class="fal fa-long-arrow-right"></i></span></a></p> </div> </div> </div> <div class="clear"></div> <div class="question_section"> <div class="qa_widget"> <div class="qa_post qa_list"> <h3> <a href="https://tutorialspoint.com/How-to-create-headings-in-HTML-page" target="_blank">如何在 HTML 页面中创建标题?</a> </h3> <div class="qa_category" id="tags_2920"> <a href="https://tutorialspoint.com/articles/category/HTML" target="_blank"><span>HTML</span></a><a href="https://tutorialspoint.com/articles/category/Web-Development" target="_blank"><span>Web 开发</span></a><a href="https://tutorialspoint.com/articles/category/Front-End-Technology" target="_blank"><span>前端技术</span></a></div> </div> <div class="qa_answer_widget"> <a href="https://tutorialspoint.com/authors/lokesh-badavath" title="Lokesh Badavath"><img src="https://tutorialspoint.com/assets/profiles/538106/profile/60_1039031-1666073315.jpg" alt="Lokesh Badavath"></a> <div class="qa_answer_detail"> <a href="https://tutorialspoint.com/authors/lokesh-badavath" title="Lokesh Badavath">Lokesh Badavath</a> </div> <div class="flex-group"> <div class="qa_answer_dtm">更新于 2022年11月11日 07:43:28</div> <p class="views-count" title="Article Views"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 576 512"><path d="M117.2 136C160.3 96 217.6 64 288 64s127.7 32 170.8 72c43.1 40 71.9 88 85.2 120c-13.3 32-42.1 80-85.2 120c-43.1 40-100.4 72-170.8 72s-127.7-32-170.8-72C74.1 336 45.3 288 32 256c13.3-32 42.1-80 85.2-120zM288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM192 256a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zm224 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z"></path></svg>5K+ 次浏览</p> </div> <div class="clear"></div> <p>标题是您想要在网页上显示的内容的标题或副标题。标题帮助我们了解网页上的内容。标题和副标题代表网页内容中的关键概念、思想和辅助思想。HTML 具有不同级别的标题标签。标题用 `<h1>` 到 `<h6>` 标签定义。使用标题来显示 HTML 文档结构非常重要。应将 `<h1>` 用于主标题,然后是 `<h2>`,依此类推,直到 `<h6>`。语法如下……<a href="https://tutorialspoint.com/How-to-create-headings-in-HTML-page"><span class="read_more">阅读更多 <i class="fal fa-long-arrow-right"></i></span></a></p> </div> </div> </div> <div class="clear"></div> <div class="job-index qa_widget" style="padding:0px 10px 0px 10px!important; margin:0px!important;"> <div class="pages"> <a href="https://tutorialspoint.com/articles/category/web-development/972" title="上一页"><i class="fal fa-angle-left"></i> 上一页</a> <a class="number" title="跳转到第 1 页,共 1044 页" href="https://tutorialspoint.com/articles/category/web-development/1">1</a> ... <a class="number" title="跳转到第 971 页,共 1044 页" href="https://tutorialspoint.com/articles/category/web-development/971">971</a> <a class="number" title="跳转到第 972 页,共 1044 页" href="https://tutorialspoint.com/articles/category/web-development/972">972</a> <a title="跳转到第 973 页,共 1044 页" class="current number" href="https://tutorialspoint.com/articles/category/web-development/973">973</a> <a class="number" title="跳转到第 974 页,共 1044 页" href="https://tutorialspoint.com/articles/category/web-development/974">974</a> <a class="number" title="跳转到第 975 页,共 1044 页" href="https://tutorialspoint.com/articles/category/web-development/975">975</a> ... <a class="number" title="跳转到第 1044 页,共 1044 页" href="https://tutorialspoint.com/articles/category/web-development/1044">1044</a> <a href="https://tutorialspoint.com/articles/category/web-development/974" title="下一页">下一页 <i class="fal fa-angle-right"></i></a></div> </div> <div class="clear py-2"></div> <div class="bottom-library-ads mt" style="margin:5px;"> <div class="google-bottom-ads" id="google-bottom-ads" style="height:450px;"> <div>广告</div> <div> <div id="ezoic-pub-ad-placeholder-131"></div> <div id="ezoic-pub-ad-placeholder-135"></div> <script> ezstandalone.cmd.push(function() { var width = window.innerWidth; if( width <= 768 ){ ezstandalone.showAds(135); document.getElementById("ezoic-pub-ad-placeholder-131").remove(); document.getElementById("google-right-ads").remove(); }else{ ezstandalone.showAds(131); document.getElementById("ezoic-pub-ad-placeholder-135").remove(); } }); </script> </div> </div> </div> </div> <div> <div class="data-sticky" id="google-right-ads"> <div class="google-right-ad" style="margin: 0px auto !important;margin-top:5px;min-height:280px!important"> <div id="ezoic-pub-ad-placeholder-127"></div> <script> ezstandalone.cmd.push(function() { ezstandalone.showAds(127); }); </script> </div> <div class="google-right-ad" style="margin-top:16px;min-height:280px!important"> <div id="ezoic-pub-ad-placeholder-128"></div> <script> ezstandalone.cmd.push(function() { ezstandalone.showAds(128); }); </script> </div> <div class="google-right-ad" style="margin-top:16px;margin-bottom:15px;min-height:600px!important"> <div id="ezoic-pub-ad-placeholder-129"></div> <script> ezstandalone.cmd.push(function() { ezstandalone.showAds(129); }); </script> </div> </div> </div> </div> </div> </main> <footer class="footer bg-neutral-800"> <div class="container"> <div> <h5>TOP TUTORIALS</h5> <ul> <li><a href="/python/index.htm" title="Python Tutorial">Python Tutorial</a></li> <li><a href="/java/index.htm" title="Java Tutorial">Java Tutorial</a></li> <li><a href="/cplusplus/index.htm" title="C++ Tutorial">C++ Tutorial</a></li> <li><a href="/cprogramming/index.htm" title="C Programming Tutorial">C Programming Tutorial</a></li> <li><a href="/csharp/index.htm" title="C# Tutorial">C# Tutorial</a></li> <li><a href="/php/index.htm" title="PHP Tutorial">PHP Tutorial</a></li> <li><a href="/r/index.htm" title="R Tutorial">R Tutorial</a></li> <li><a href="/html/index.htm" title="HTML Tutorial">HTML Tutorial</a></li> <li><a href="/css/index.htm" title="CSS Tutorial">CSS Tutorial</a></li> <li><a href="/javascript/index.htm" title="JavaScript Tutorial">JavaScript Tutorial</a></li> <li><a href="/sql/index.htm" title="SQL Tutorial">SQL Tutorial</a></li> </ul> </div> <div> <h5>TRENDING TECHNOLOGIES</h5> <ul> <li><a href="/cloud_computing/index.htm" title="Cloud Computing Tutorial">Cloud Computing Tutorial</a></li> <li><a href="/amazon_web_services/index.htm" title="Amazon Web Services Tutorial">Amazon Web Services Tutorial</a></li> <li><a href="/microsoft_azure/index.htm" title="Microsoft Azure Tutorial">Microsoft Azure Tutorial</a></li> <li><a href="/git/index.htm" title="Git Tutorial">Git Tutorial</a></li> <li> <a href="/ethical_hacking/index.htm" title="Ethical Hacking Tutorial">Ethical Hacking Tutorial</a></li> <li><a href="/docker/index.htm" title="Docker Tutorial">Docker Tutorial</a></li> <li><a href="/kubernetes/index.htm" title="Kubernetes Tutorial">Kubernetes Tutorial</a></li> <li><a href="/data_structures_algorithms/index.htm" title="DSA Tutorial">DSA Tutorial</a></li> <li><a href="/spring_boot/index.htm" title="Spring Boot Tutorial">Spring Boot Tutorial</a></li> <li><a href="/sdlc/index.htm" title="SDLC Tutorial">SDLC Tutorial</a></li> <li><a href="/unix/index.htm" title="Unix Tutorial">Unix Tutorial</a></li> </ul> </div> <div> <h5>CERTIFICATIONS</h5> <ul> <li><a href="/certification/business-analytics-certification-2023/index.asp" title="Business Analytics Certification">Business Analytics Certification</a></li> <li><a href="/certification/java-prime-pack/index.asp" title="Java & Spring Boot Advanced Certification">Java & Spring Boot Advanced Certification</a></li> <li><a href="/certification/data-science-advanced-certification/index.asp" title="Data Science Advanced Certification">Data Science Advanced Certification</a></li> <li><a href="/certification/cloud-computing-and-devops-advanced-certification/index.asp" title="Cloud Computing And DevOps">Cloud Computing And DevOps</a></li> <li><a href="/certification/advanced-certification-in-business-analytics/index.asp" title="Advanced Certification In Business Analytics">Advanced Certification In Business Analytics</a></li> <li><a href="/certification/artificial-intelligence-and-machine-learning-certification/index.asp" title="Artificial Intelligence And Machine Learning">Artificial Intelligence And Machine Learning</a></li> <li><a href="/certification/devops-certification/index.asp" title="DevOps Certification">DevOps Certification</a></li> <li><a href="/certification/game-development-prime-pack/index.asp" title="Game Development Certification">Game Development Certification</a></li> <li><a href="/certification/frontend-developer-certification/index.asp" title="Front-End Developer Certification">Front-End Developer Certification</a></li> <li><a href="/certification/aws-prime-pack/index.asp" title="AWS Certification Training">AWS Certification Training</a></li> <li><a href="/certification/complete-python-prime-pack/index.asp" title="Python Programming Certification">Python Programming Certification</a></li> </ul> </div> <div> <h5>COMPILERS & EDITORS</h5> <ul> <li><a href="/online_java_compiler.php" title="Online Java Compiler">Online Java Compiler</a></li> <li><a href="/online_python_compiler.php" title="Online Python Compiler">Online Python Compiler</a></li> <li><a href="/execute_golang_online.php" title="Online Go Compiler">Online Go Compiler</a></li> <li><a href="/compile_c_online.php" title="Online C Compiler">Online C Compiler</a></li> <li><a href="/compile_cpp_online.php" title="Online C++ Compiler">Online C++ Compiler</a></li> <li><a href="/online_csharp_compiler.php" title="Online C# Compiler">Online C# Compiler</a></li> <li><a href="/execute_php_online.php" title="Online PHP Compiler">Online PHP Compiler</a></li> <li><a href="/execute_matlab_online.php" title="Online MATLAB Compiler">Online MATLAB Compiler</a></li> <li><a href="/execute_bash_online.php" title="Online Bash Compiler">Online Bash Compiler</a></li> <li><a href="/execute_sql_online.php" title="Online SQL Compiler">Online SQL Compiler</a></li> <li><a href="/online_html_editor.php" title="Online Html Editor">Online Html Editor</a></li> </ul> </div> </div> <ul class="footer__list container"> <li><a href="/about/index.htm" title="ABOUT US">ABOUT US</a> | </li> <li><a href="/about/about_team.htm" title="OUR TEAM">OUR TEAM</a> | </li> <li><a href="/about/about_careers.htm" title="CAREERS">CAREERS</a> | </li> <li><a href="/job_search.php" title="JOBS">JOBS</a> | </li> <li><a href="/about/contact_us.htm" title="CONTACT US">CONTACT US</a> | </li> <li><a href="/about/about_terms_of_use.htm" title="TERMS OF USE">TERMS OF USE</a> | </li> <li><a href="/about/about_privacy.htm" title="PRIVACY POLICY">PRIVACY POLICY</a> | </li> <li><a href="/about/return_refund_policy.htm" title="REFUND POLICY">REFUND POLICY</a> | </li> <li><a href="/about/about_cookies.htm" title="COOKIES POLICY">COOKIES POLICY</a> | </li> <li><a href="/about/faq.htm" title="FAQ'S">FAQ'S</a></li> </ul> <div class="footer__socials container"> <img class="footer__logo" src="https://tutorialspoint.com/static/images/logo-footer.svg" alt="tutorials point logo"> <div> <a rel="nofollow" target="_blank" href="https://www.facebook.com/tutorialspointindia" title="Follow us on Facebook"><i class="fab fa-2x fa-facebook"></i></a> <a target="_blank" href="https://twitter.com/tutorialspoint" rel="nofollow" title="Follow us on Twitter"><i class="fab fa-2x fa-x-twitter"></i></a> <a target="_blank" href="https://www.youtube.com/channel/UCVLbzhxVTiTLiVKeGV7WEBg" rel="nofollow" title="Follow us on Youtube"><i class="fab fa-2x fa-youtube"></i></a> <a target="_blank" href="https://www.linkedin.com/company/tutorialspoint/" rel="nofollow" title="Follow us on LinkedIn"><i class="fab fa-2x fa-linkedin"></i></a> <a target="_blank" href="https://www.instagram.com/tutorialspoint_/" rel="nofollow" title="Follow us on Instagram"><i class="fab fa-2x fa-instagram"></i></a> </div> <div class="flex-group"> <button class="button-reset"><a href="https://play.google.com/store/apps/details?id=com.tutorialspoint.onlineviewer" target="_blank" title="Download Android App" rel="nofollow"><img src="https://tutorialspoint.com/static/images/googleplay.svg" alt="Download Android App"></a></button> <button class="button-reset"><a href="https://itunes.apple.com/us/app/tutorials-point/id914891263?ls=1&mt=8" target="_blank" title="Download IOS App" rel="nofollow"><img src="https://tutorialspoint.com/static/images/appstore.svg" alt="Download IOS App"></a></button> </div> </div> <div class="footer__legal-wrapper"> <div class="footer__legal ff-nunito"> <p> </p><p class="">Tutorials Point is a leading Ed Tech company striving to provide the best learning material on technical and non-technical subjects.</p> <p></p> <p class="footer__copyright ">© Copyright 2024. All Rights Reserved.</p> </div> </div> </footer> <script src="/static/js/lib-script.js?v13.13"></script> <script src="https://127.0.0.1/gsi/client" async="" defer=""></script> <script> function addParagraphs(ind) { let techLinks =[["Python","JavaScript","Spring Boot","Java","Linux/Unix","C#","Data Science","MySQL","Artificial Intelligence","SQL"], ["https://tutorialspoint.com/certification/complete-python-prime-pack/index.asp?utm_source=tutorialspoint&utm_medium=python_tutorial_3p&utm_campaign=internal", "https://tutorialspoint.com/certification/javascript-prime-pack/index.asp?utm_source=tutorialspoint&utm_medium=javascript_tutorial_3p&utm_campaign=internal", "https://tutorialspoint.com/certification/ultimate-guide-to-java-and-spring-boot-for-2022/index.asp?utm_source=tutorialspoint&utm_medium=java_tutorial_3p&utm_campaign=internal", "https://tutorialspoint.com/certification/ultimate-guide-to-java-and-spring-boot-for-2022/index.asp?utm_source=tutorialspoint&utm_medium=spring_boot_tutorial_3p&utm_campaign=internal", "https://tutorialspoint.com/certification/linux-system-administrator-certification/index.asp?utm_source=tutorialspoint&utm_medium=unix_tutorial_3p&utm_campaign=internal", "https://tutorialspoint.com/certification/chash-and-net-prime-pack/index.asp?utm_source=tutorialspoint&utm_medium=csharp_tutorial_3p&utm_campaign=internal", "https://tutorialspoint.com/certification/data-science-prime-pack/index.asp?utm_source=tutorialspoint&utm_medium=data_science_tutorial_3p&utm_campaign=internal", "https://tutorialspoint.com/certification/mysql-technologies-pack/index.asp?utm_source=tutorialspoint&utm_medium=mysql_tutorial_3p&utm_campaign=internal", "https://tutorialspoint.com/certification/artificial-intelligence-and-machine-learning-certification/index.asp?utm_source=tutorialspoint&utm_medium=artificial_intelligence_tutorial_3p&utm_campaign=internal", "https://tutorialspoint.com/certification/mysql-technologies-pack/index.asp?utm_source=tutorialspoint&utm_medium=sql_tutorial_3p&utm_campaign=internal"]] var p2 = ''; if(ind>=0){ p2 = p2 + '<a style="text-decoration:none;" href="' + techLinks[1][ind] +'" target="_blank" ><p class="prmt_ad">Learn <strong>'+ techLinks[0][ind] + '</strong> in-depth with real-world projects through our <strong>' + techLinks[0][ind] + ' certification course</strong>. Enroll and become a certified expert to boost your career.</p></a>'; } else{ p2 = p2 + '<a href="https://tutorialspoint.com/latest/courses?utm_source=tutorialspoint&utm_medium=tutorials_3p&utm_campaign=internal" style="text-decoration:none;" target="_blank"><p class="prmt_ad">Explore our <strong>latest online courses</strong> and learn new skills at your own pace. Enroll and become a certified expert to boost your career.</p></a>'; } $(p2).insertBefore($('.tutorial-content h2').eq(2)); } $(document).ready(function() { var url= window.location.href.toLowerCase(); if(url.indexOf('python') > -1){ addParagraphs(0); } else if(url.indexOf('javascript') > -1){ addParagraphs(1); } else if(url.indexOf('spring_boot') > -1){ addParagraphs(2); } else if(url.indexOf('java') > -1){ addParagraphs(3); } else if((url.indexOf('unix') > -1)||(url.indexOf('linux') > -1)){ addParagraphs(4); } else if((url.indexOf('csharp') > -1)||(url.indexOf('chash') > -1)){ addParagraphs(5); } else if(url.indexOf('data_science') > -1){ addParagraphs(6); } else if(url.indexOf('mysql') > -1){ addParagraphs(7); } else if((url.indexOf('artificial_intelligence') > -1)||(url.indexOf('artificial-intelligence') > -1)){ addParagraphs(8); } else if(url.indexOf('sql') > -1){ addParagraphs(9); } else{ addParagraphs(-1); } }); </script> <script> if(getCookie('user_id') == '' || getCookie('user_id') == null){ window.onload = function() { initializeGoogleOneTap(); }; } </script> <script src="https://tutorialspoint.com/fontawesome/js/all.min.js?v2.9"></script> <script src="https://127.0.0.1/cmp.min.js" data-cfasync="false"></script> <script async="" src="/static/js/ezoic-ad-inserter.js?v4.2"></script> <!-- Google tag (gtag.js) --> <script async="" src="https://127.0.0.1/gtag/js?id=G-E4SW76VCNP"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-E4SW76VCNP'); </script> <!-- New Facebook Pixel Code --> <script> !function(f,b,e,v,n,t,s) {if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)}; if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0]; s.parentNode.insertBefore(t,s)}(window,document,'script', 'https://127.0.0.1/en_US/fbevents.js'); fbq('init', '854536859149047'); fbq('track', 'PageView'); </script> <!-- End facebook Pixel Code --> <footer style="margin: 2em 2em 4em; font-size: small; text-align: center;"> © <script>document.write(new Date().getFullYear() + ' ' + location.host)</script>. All rights reserved. </footer></body></html>