本文介绍了描述列表或定义列表以及它在 HTML 文档中的用途。那么如何定义描述列表呢?简而言之,我们可以说它是定义列表(例如,在互联网/网页上呈现信息的术语表)。然而,描述列表的使用较少,但有一定的用途。同时,这个定义列表给网页带来了附加值;例如,网页上给出的文本解释了上下文,换句话说,帮助通过语义标记上下文。通过这样做,我们可以轻松地提取结构化信息。定义列表是描述术语、值和另一个术语表的完美术语。
语法:
<dl> <dt> …… </dt> <dd> ……….. </dd> </dl
描述列表中有三个元素,分别是
描述列表是列表类型之一;它们被认为是有序项目符号列表的通用形式。唯一的区别是没有项目符号图标。
注意:任何定义列表都包含示例#1
<!DOCTYPE html> <html> <body> <dl> <dt><b>Web Designing company in Chennai<b></dt> <dd>This service Enhance Website Exposure with professional User Interface </dd> </dl> </body> </html>
输出:
示例 #2
<html> <head> <title>Page Title</title> <style> body { background-color: pink; text-align: center; color: blue; font-family: Arial, italic; } </style> </head> <body> <h1>HTML Demo 2</h1> <p>This is Networking Protocol Abbreviation.</p> <dl> <dt>FTP <dd>File Transfer Protocol <dt>TCP/IP <dd>Transmission Control Protocol/IP address <dt>SNMP <dd>Simple Network Management Protocol </dl> </body> </html>
输出:
示例#1
<!DOCTYPE html> <html> <body> <dl> <dt> Ebay</dt> <dt>Etsy</dt> <dt>Walmart</dt> <dd>The Top 10 internet shopping websites in the year 2019</dd> </dl> </body> </html>
输出:
接下来,我们将在
示例#2
<!DOCTYPE html> <html> <body> <h2>A Description HTML list</h2> <dl lang="es"> <dt>formas</dt> <dt lang="en-us">Shapes</dt> <dt lang="fr">Formes</dt> <dd>A Shape determines the different structure of the objects. </dd> </dl> </body> </html>
输出:
示例
<html> <head> <title>DEFINITION LIST</title> </head> <body bgcolor=" brown" text="pink"> <h1><u>DEFINITION LIST DEMO</u></h1> <h3> <dl> <dt lang="es"><u>Compact:</u></dt> <dd>A Compact may refer to make-up case. </dd> <dd>When taken as adjective it refers to smaller part. Example, need a compact sofa to sit.</dd> </dl> <h3> </body> </html>
输出:
示例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.1"> <title>Definition List example</title> </head> <body> <h1>Definition List Demo4</h1> <dl> <dt> Engaged</dt> <dt>Leaves</dt> <dd>Students got engaged during their Lab hours in the college.</dd> <dd>Childrens feels when their father leaves for the work.</dd> </dl> </body> </html>
输出:
此处为颜色指定样式属性,以突出显示描述术语。
示例#1
<html> <head> HTML Definition Lists </head> <body> <h2> list of Popular International Entrance Examination <h2> <dl> <dt style="color:Blue"> TOEFL </dt> <dd> -: Test of English As Foreign Language . This Score is Accepted in the country like Canada,UK,USA</dd> <br> <dt style="color:Magenta"> GRE </dt> <dd> -: The Graduate Record Examination. This Test is allowed to enter in the States like Canada and US foran indian Students in the Science and Technology Fields </dd> </dl> </body> </html>
输出:
使用 标签,据了解,附近的文本被指定为该术语的定义。
示例#2
<!DOCTYPE html> <html> <head> <title> Demo</title> <dl> <dt lang="en-GB"><dfn> Definition list</dfn></dt> <dt><dfn><b>Apple fruit </b></dfn></dt> <dd>This fruit is quoted as "miracle food" where this gives best nutrients to the body. They are rich in antioxidents</dd> <dd>A small fragment of apple intakes daily cures cancer,heart disease etc.</dd> <dd> Different varieties includes Braeburn,Cameo,Fuji,Gala </dd> </dl> </html>
输出:
下面的示例通过使用属性“bgcolor”显示带有背景颜色的内容。
示例
<html> <head> <title>DEFINITION LIST</title> </head> <body bgcolor="Green" text="pink"> <h1><u>DEFINITION LIST DEMO</u></h1> <h3> <dl> <dt lang="en-GB"><u>PYTHON:</u></dt> <dd>Python is a progranning Language originally developed by Guido van. Its an Open Source and Cross-Platform. Applications include Web development, Data Machine Learning </dd> </dl> <h3> </body> </html> </dl> </html>
输出:
我们希望这篇关于定义列表的文章或者可以说是术语表列表已经指导了演示定义列表的一些可用用途。我们已经对如何使用这些技术在信息片段之间开展有用的合作有了基本的了解。例如,谷歌词汇表给出了如何标记有意义的信息并以多种方式在网页上使用。它们具有未来的功能,一些网站使用语义来呈现其数据的美感,并如此简单和灵活地重用给定的信息。
以上是HTML 描述列表的详细内容。更多信息请关注PHP中文网其他相关文章!