แท็ก ใน HTML ทำงานเป็นคอนเทนเนอร์สำหรับองค์ประกอบต่อไปนี้ −
, <style>, <base>, <link>, <meta>, <script>, <noscript>.</P> <p>
ใน HTML5 คุณสามารถทำงานกับเอกสาร HTML โดยไม่รวมองค์ประกอบ <head></P> <p>
<strong><title> ข้างใน <head></strong> </P> <p>
เรามาดูตัวอย่างการใช้งานแท็ก <head> และเพิ่ม <title> −</P> <h2>ตัวอย่าง</h2> <pre><!DOCTYPE html>
<html>
<head>
<title>Document Title</title>
</head>
<body>
<h2>Demo Heading</h2>
<p>This is demo text.</p>
<p>This is demo text.</p>
<p>This is demo text.</p>
<p>This is demo text.</p>
</body>
</html></pre> <p>
สิ่งนี้จะสร้างผลลัพธ์ที่แสดงชื่อของเอกสารที่เราเพิ่มภายใต้องค์ประกอบ <head> -</P> <p>
<img loading='lazy' alt='HTML head แท็ก ' src="/article/uploadfiles/202203/2022033116063442.jpg" /></P> <p>
<strong><base> ข้างใน <head></strong> </P> <p>
แท็กฐานใน HTML ใช้เพื่อตั้งค่า URL พื้นฐานสำหรับเอกสาร HTML <head> ทำหน้าที่เป็นคอนเทนเนอร์สำหรับองค์ประกอบ <base> เช่นกัน ตัวอย่างเช่น URL ฐานเป็น<strong> https −//example.com/tutorials</strong> สำหรับ URL ที่เกี่ยวข้องทั้งหมด เช่น <strong>/html, /java, /jquery</strong> เป็นต้น ซึ่งในที่สุด −</P> <pre>https −//example.com/tutorials/html
https −//example.com/tutorials/java
https −//example.com/tutorials/jquery</pre> <p>
<strong>หมายเหตุ</strong> − แท็ก <base> ไม่มีแท็กปิด เช่น ไม่จำเป็นต้องลงท้ายด้วย </base></P> <p>
ต่อไปนี้เป็นคุณลักษณะ -</P> <ul> <li><strong>href</strong> − ตั้งค่า URL พื้นฐานสำหรับ URL ที่เกี่ยวข้องทั้งหมดในหน้า</li>
<li><strong>เป้าหมาย</strong> − เป้าหมายเริ่มต้นสำหรับไฮเปอร์ลิงก์และแบบฟอร์มทั้งหมด ค่าสามารถเป็น _blank, _parent, _self, _top และ framename ได้</li>
</ul>
<p>
ให้เรามาดูตัวอย่างการใช้งาน <base> องค์ประกอบ -</P> <h2>ตัวอย่าง</h2> <pre><!DOCTYPE html>
<html>
<head>
<base href="https −//www.example.com/tutorials/">
</head>
<body>
<h2>Tutotials List</h2>
<p><a href="java.html">Java Tutorial</a></p><p>(This will act as https −//www.example.com/tutorials/java.html)</p>
<p><a href="jquery.html">jQuery Tutorial</a></p><p>(This will act as https −//www.example.com/tutorials/jquery.html)</p>
<p><a href="blockchain.html">Blockchain Tutorial</a></p><p>(This will act as https −//www.example.com/tutorials/blockchain.html)</p>
<p><a href="python.html">Python Tutorial</a></p><p>(This will act as https −//www.example.com/tutorials/python.html)</p>
</body>
</html></pre> <h2>ผลลัพธ์</h2> <p>
<img loading='lazy' alt='HTML head แท็ก ' src="/article/uploadfiles/202203/2022033116063560.jpg" /></P> <br>
</article>
<div class="ad ad5">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4480737146802772" crossorigin="anonymous"></script><!-- computer.wsxdn --><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-4480737146802772" data-ad-slot="4467655591" data-ad-format="auto" data-full-width-responsive="true"></ins><script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>
</div>
<section id="turn-page" class="t-over">
<div class="f-start f-align">
<i><img loading='lazy' src="https://th.wsxdn.com/css/img/sanjiao.svg" alt=""></i>
<a class='LinkPrevArticle' href='https://th.wsxdn.com/db044w/zx451s/1004064272.html' >จะเปลี่ยนแบบอักษรข้อความสำหรับ JLabel ด้วย HTML ใน Java ได้อย่างไร? </a>
</div>
<div class="f-start f-align">
<i><img loading='lazy' src="https://th.wsxdn.com/css/img/sanjiao.svg" alt=""></i>
<a class='LinkNextArticle' href='https://th.wsxdn.com/db044w/zx451s/1004064274.html' >HTML <del> แท็ก </a>
</div>
</section>
<section class="box1-3">
<ol class="f-between">
<li class="aList-2 aList f-between f-align">
<div>
<a href="https://th.wsxdn.com/db044w/zx451s/1004064379.html" class="title">
<p class="r-over r-over-2" title="HTML <เวลา> แท็ก ">
HTML <เวลา> แท็ก </p>
</a>
</div>
</li><li class="aList-2 aList f-between f-align">
<div>
<a href="https://th.wsxdn.com/db044w/zx451s/1004064399.html" class="title">
<p class="r-over r-over-2" title="HTML <dl> แท็ก ">
HTML <dl> แท็ก </p>
</a>
</div>
</li><li class="aList-2 aList f-between f-align">
<div>
<a href="https://th.wsxdn.com/db044w/zx451s/1004064408.html" class="title">
<p class="r-over r-over-2" title="HTML <embed> แท็ก ">
HTML <embed> แท็ก </p>
</a>
</div>
</li><li class="aList-2 aList f-between f-align">
<div>
<a href="https://th.wsxdn.com/db044w/zx451s/1004064409.html" class="title">
<p class="r-over r-over-2" title="HTML <dfn> แท็ก ">
HTML <dfn> แท็ก </p>
</a>
</div>
</li>
</ol>
</section>
</section>
<aside class="box-r">
<section class="box4-1">
<strong>
HTML
</strong>
<ol>
<li class="f-start">
<i>
<img loading='lazy' src="https://th.wsxdn.com/css/img/article-lan.svg" alt="">
</i>
<a href="https://th.wsxdn.com/db044w/zx451s/1004063717.html" title="เหตุใดเราจึงใช้แท็ก head ในหน้า HTML ">
<p class="r-over r-over-2">เหตุใดเราจึงใช้แท็ก head ในหน้า HTML </p>
</a>
</li>
<li class="f-start">
<i>
<img loading='lazy' src="https://th.wsxdn.com/css/img/article-lan.svg" alt="">
</i>
<a href="https://th.wsxdn.com/db044w/zx451s/1004064263.html" title="แท็กผ้าใบ HTML ">
<p class="r-over r-over-2">แท็กผ้าใบ HTML </p>
</a>
</li>
<li class="f-start">
<i>
<img loading='lazy' src="https://th.wsxdn.com/css/img/article-lan.svg" alt="">
</i>
<a href="https://th.wsxdn.com/db044w/zx451s/1004064274.html" title="HTML <del> แท็ก ">
<p class="r-over r-over-2">HTML <del> แท็ก </p>
</a>
</li>
<li class="f-start">
<i>
<img loading='lazy' src="https://th.wsxdn.com/css/img/article-lan.svg" alt="">
</i>
<a href="https://th.wsxdn.com/db044w/zx451s/1004064277.html" title="HTML <dd> แท็ก ">
<p class="r-over r-over-2">HTML <dd> แท็ก </p>
</a>
</li>
<li class="f-start">
<i>
<img loading='lazy' src="https://th.wsxdn.com/css/img/article-lan.svg" alt="">
</i>
<a href="https://th.wsxdn.com/db044w/zx451s/1004064280.html" title="HTML <code> แท็ก ">
<p class="r-over r-over-2">HTML <code> แท็ก </p>
</a>
</li>
</ol>
</section>
<ul>
<li class="f-start f-align">
<a href="https://th.wsxdn.com/db044w/zx451s/1004064331.html" class="i-text"><p class="r-over r-over-3">HTML <samp>
แท็ก </p></a>
</li>
<li class="f-start f-align">
<a href="https://th.wsxdn.com/db044w/zx451s/1004064332.html" class="i-text"><p class="r-over r-over-3">HTML <s> แท็ก </p></a>
</li>
<li class="f-start f-align">
<a href="https://th.wsxdn.com/db044w/zx451s/1004064347.html" class="i-text"><p class="r-over r-over-3">HTML <b> แท็ก </p></a>
</li>
<li class="f-start f-align">
<a href="https://th.wsxdn.com/db044w/zx451s/1004064351.html" class="i-text"><p class="r-over r-over-3">HTML <ที่อยู่> แท็ก </p></a>
</li>
<li class="f-start f-align">
<a href="https://th.wsxdn.com/db044w/zx451s/1004064362.html" class="i-text"><p class="r-over r-over-3">HTML <blockquote> แท็ก </p></a>
</li>
</ul>
<ul class="types f-between">
<li><a class='childclass' href='https://th.wsxdn.com/db044w/hf444z/' target="_self">การเขียนโปรแกรม C</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/bz445u/' target="_self">C++</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/tr446l/' target="_self">Redis</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/rp447j/' target="_self">การเขียนโปรแกรม BASH</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/wu448o/' target="_self">Python</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/nl449f/' target="_self">Java</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/ig450a/' target="_self">ฐานข้อมูล</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/zx451s/' target="_self">HTML</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/ec452w/' target="_self">Javascript</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/db453v/' target="_self">การเขียนโปรแกรม</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/if454a/' target="_self">CSS</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/ge455y/' target="_self">Ruby</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/xv456p/' target="_self">SQL</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/jh457b/' target="_self">IOS</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/om458g/' target="_self">Android</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/mk459f/' target="_self">MongoDB</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/rp460j/' target="_self">MySQL</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/qn461i/' target="_self">C#</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/jh465b/' target="_self">PHP</a></li>
<li><a class='childclass' href='https://th.wsxdn.com/db044w/kh471c/' target="_self">SQL Server</a></li>
</ul>
</aside>
</section>
<footer>
<section class="msg f-center container">
<span class="f-start">
ลิขสิทธิ์ ©
<a href="https://th.wsxdn.com">https://th.wsxdn.com</a>
สงวนลิขสิทธิ์
</span>
</section>
</footer>
</body>
</html>