Computer >> 컴퓨터 >  >> 프로그램 작성 >> HTML

HTML
태그

<시간/>

HTML의 dl 요소는 설명 목록을 정의하는 데 사용됩니다. HTML5에서

은 설명 목록을 정의하는 데 사용되는 반면 HTML4의
은 정의 목록을 정의하는 데 사용됩니다.

이제

태그 −

를 구현하는 예를 살펴보겠습니다.

예시

<!DOCTYPE html>
<html>
<body>
<h2>Sports</h2>
<dl>
   <dt>Football</dt>
      <dd>It is played by 250 million players in over 200 countries.</dd>
   <dt>Cricket</dt>
      <dd>It is a bat-and-ball game played between two teams of eleven players on a field.</dd>
   <dt>Hockey</dt>
      <dd>There are many types of hockey such as bandy, field hockey, and ice hockey.</dd>
   <dt>Golf</dt>
      <dd>It is a club-and-ball sport in which players use various clubs to hit balls into a series of holes on a course in as few strokes as possible.</dd>
</dl>
</body>
</html>

출력

HTML  dl  태그

위의 예에서 설명 목록을 설정하기 위해

을 설정했습니다 -

<dl>
   <dt>Football</dt>
      <dd>It is played by 250 million players in over 200 countries.</dd>
   <dt>Cricket</dt>
      <dd>It is a bat-and-ball game played between two teams of eleven players on a field.</dd>
   <dt>Hockey</dt>
      <dd>There are many types of hockey such as bandy, field hockey, and ice hockey.</dd>
   <dt>Golf</dt>
      <dd>It is a club-and-ball sport in which players use various clubs to hit balls into a series of holes on a course in as few strokes as possible.</dd>
</dl>

위의

요소는 정의 목록에서 용어를 정의하는 반면
도 용어를 정의하지만
내부에 링크, 이미지, 줄 바꿈을 추가할 수 있습니다.