HTML dt dd tags
In this article, we will see what is HTML dt and dd tags. We need to use both <dt> and <dd> tags inside the <dl>. These three tags are paired tags, so we should use opening and closing tags. dl tag means definition list, dt tag means definition term, and dd tag means definition description. We can use the dt tag is used to create a definition title or sub titles. dd tag is used to create a description.
syntax:
<dl>
<dt> definiton title </dt>
<dd> description </dd>
</dl>
Example:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<dl>
<dt>HTML:</dt>
<dd>HTML is formatting language for web pages. It is used create structure of a webpage.</dd>
</dl>
</body>
</html>
Output:
Steps:
- In the above code, we have created the <dl> tag and within that, we have created the <dt> and <dd> tags.
- Between the <dt> tag, we put a definition title called “HTML”. Between the <dd> tag, we put some description about HTML.
- See the above output, the definition title is displayed as the title and the description will be displayed with some spacing