<html> <head><title>Definiton List</title></head> <body> <dl> <dt>Resistor</dt> <dd>It is an electronic component that has the ability to oppose or limit the flow of current.</dd> </dl> <dl> <dt>Capacitor</dt> <dd>It is an electronic component that has the ability to store electrical charge for a short period of time.</dd> </body> </html>
The code will be displayed this way by the browser.
About the Code:
- The <dl> tag is the opening tag of definition list. It tells the browser that a definition list is about to start.
- The <dt> tag is used in conjunction with <dl> and <dd> tag. It means definition term and it is not indented.
- The </dt> tag is used to tell the browser that the definition term has ended.
- The <dd> tag describes the definition term. It means definition description. It instructs the browser to start the definition description. It appears indented.
- The </dd> tag is used to close the definition description tag.
- The </dl> tag tells the browser to end the definition list.