우리 모두 알고 있듯이 HTML은 웹 개발 분야에서 끊임없이 발전하고 있으며 전 세계적으로 인기 있는 마크업 언어입니다. 웹 개발자들은 HTML 요소에 대한 업데이트와 학습이 필요하다고 합니다. 이번 글에서는 time 태그라고 불리는 몇 가지 중요한 태그에 대해 알아보겠습니다. 사람이 날짜/시간을 다양한 형태로 읽는 것은 쉽지만, 기계의 경우
시간은 다음과 같은 방법으로 정의할 수 있습니다.
시간
24시간 정확한 시간
양력의 날짜
시간 진행의 이점으로 웹 페이지는 더욱 구조화되고 검색 엔진에서 HTML 코드를 쉽게 읽을 수 있도록 하여 웹 페이지의 아이디어를 분석하고 이벤트 일정 및 시간 관련 이벤트 기능을 개발하는 데 이점을 제공합니다. 예를 들어 검색 엔진에서는 현재 이벤트와 연결되어 시각적 시간 이벤트를 통해 현재 웹 페이지의 순위를 높이는 데 도움이 됩니다.
구문:
<time> 2020-01-28 </time>
기본 날짜-시간 속성을 사용하면 컴퓨터에 사용되는 특정 형식의 고유한 시간 태그가 제공됩니다.
위 구문에서 태그에는 시간, 날짜 또는 둘 다를 모두 포함합니다. 예상되는 형식은 가장 큰 기간부터 낮은 기간 순으로 제공됩니다. 연도 – 월-일 hh: mm: ss 시간대. 날짜 시간 속성이 없으면 이 형식이 사용됩니다.
속성
HTML에서는 속성이 중요한 역할을 합니다. 이 HTML 요소를 사용하면 사용자는 업무에 일정 날짜를 추가하고 각자의 달력에 생일 알림을 유연하게 추가할 수 있습니다. 또 다른 이점은 검색 엔진이 더 나은 검색 결과를 제공할 수 있다는 것입니다. 이 시간 요소는 전역 및 이벤트 속성을 지원합니다. 그 외에도 필수 속성은 날짜 시간입니다. '월요일'과 같은 값을 표시하기 위해 '금요일' 날짜-시간 속성을 표현합니다.
아래 표는 이 요소와 관련된 속성과 설명을 보여줍니다.
Attribute Name
Description
DateTime
It specifies a machine-readable input time of the element.
Pubdate
It has a Boolean value that Specifies the publication date of the content.
속성 이름
설명
날짜시간
기계가 읽을 수 있는 요소의 입력 시간을 지정합니다.
게시
콘텐츠 게시 날짜를 지정하는 부울 값이 있습니다.
There are some different ways of representing the date-time attribute. The profile of ISO 8601 provides the standards which follow the ABNF notation. And the letters below ‘T’ and ‘Z’ should be declared in the Upper case.
1. Year and Month
Very Simple Format with the year before.
2019 – 08
2. Date Alone
1946-08-17
3. Date without Year
08-21
4. Only Time Display
13: 55: 30. 522
5. Date and Time
2014 – 08 -21T15:55
Here T is for separation between Date and Time.
6. Time Zone Format
It initiates with either plus or minus and, in some cases, ( : ) is replaced With the capital ‘Z’.
+ 08 : 05
7. Year and Week
Follow the corresponding number of weeks after the letter ‘W’ to represent a week.
2017 – W 20
8. Duration (with Two methods)
2w 3d 4 h 25 min 12.402s
Also, it supports global attribute along with this element like id, class, style and supporting event attributes like onabort, onfocus, onclick, onmousedown, onmouseout, onkeyup, onchange, ondrag, ondrop, onselect, onmessage, onscroll.
Examples to Implement HTML Time Tag
Using this tag, You can display the date or time without a datetime attribute. The following are some examples:
Example #1 – using a tag.
Code:
<title>
HTML Time Tag
</title>
<h2 id="HTML-Time-Tag-demo">HTML Time Tag demo</h2>
<p> India celebrate as
<time>2020-01-26</time> Republic day
</p>
Output:
Example #2
Making a time element to the title attribute to show detailed information about the user in a nice human-readable or machine-readable format.
Code:
<h2 id="center-Date-Time-Example-center"> <center> Date Time Example </center> </h2>
<h3 id="The-Stand-Up-Comedy-show-starts-at-time-datetime-T-Z-time-coming-Saturday">The Stand- Up Comedy show starts at <time datetime="2018-07-04T20:00:00Z">20:00</time> coming Saturday.</h3>
<h3 id="The-preview-show-starts-in-time-datetime-PT-H-M-S-h-m-s-time">The preview show starts in <time datetime="PT3H0M3S">5h 1m 0s</time>.</h3>
In the below Output, the time tag instructs the browser about the text used between the attribute is a time reference ( 5 h 1m 0s) but doesn’t display the time attribute.
Output:
Example #3 – Using Css.
Code:
<article>
<h1 id="Title-of-the-document">Title of the document</h1>
<p>Introduction to the Article</p>
</article>
<footer>
<p>This content is published on <time>2016-1-20</time>.</p>
<p>Our shop opens at <time>08:00</time>.</p>
</footer>
Output:
Example #4 – Using pubdate attribute.
Code:
<article>
<h1 id="A-good-Article">A good Article</h1>
<p>Introduction on a given Article.</p>
<footer>
<p>Content published on <time datetime="2019-02-04" pubdate>February the 4th, 2019</time>
</p></footer>
</article>
Output:
Conclusion
Therefore, we learned how to work with the tag and also came to know how the web crawlers interpret the date and time on the web page. People started using the time tag in the HTML document as the usage of this tag increased in search engines. Using the date/time attribute, the browser clarifies the time, and some websites make their default time theme, like Reddit, word press, etc.
위 내용은 HTML 시간 태그의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!
성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
이 프로젝트는 osdn.net/projects/mingw로 마이그레이션되는 중입니다. 계속해서 그곳에서 우리를 팔로우할 수 있습니다. MinGW: GCC(GNU Compiler Collection)의 기본 Windows 포트로, 기본 Windows 애플리케이션을 구축하기 위한 무료 배포 가능 가져오기 라이브러리 및 헤더 파일로 C99 기능을 지원하는 MSVC 런타임에 대한 확장이 포함되어 있습니다. 모든 MinGW 소프트웨어는 64비트 Windows 플랫폼에서 실행될 수 있습니다.
DVWA(Damn Vulnerable Web App)는 매우 취약한 PHP/MySQL 웹 애플리케이션입니다. 주요 목표는 보안 전문가가 법적 환경에서 자신의 기술과 도구를 테스트하고, 웹 개발자가 웹 응용 프로그램 보안 프로세스를 더 잘 이해할 수 있도록 돕고, 교사/학생이 교실 환경 웹 응용 프로그램에서 가르치고 배울 수 있도록 돕는 것입니다. 보안. DVWA의 목표는 다양한 난이도의 간단하고 간단한 인터페이스를 통해 가장 일반적인 웹 취약점 중 일부를 연습하는 것입니다. 이 소프트웨어는
mPDF는 UTF-8로 인코딩된 HTML에서 PDF 파일을 생성할 수 있는 PHP 라이브러리입니다. 원저자인 Ian Back은 자신의 웹 사이트에서 "즉시" PDF 파일을 출력하고 다양한 언어를 처리하기 위해 mPDF를 작성했습니다. HTML2FPDF와 같은 원본 스크립트보다 유니코드 글꼴을 사용할 때 속도가 느리고 더 큰 파일을 생성하지만 CSS 스타일 등을 지원하고 많은 개선 사항이 있습니다. RTL(아랍어, 히브리어), CJK(중국어, 일본어, 한국어)를 포함한 거의 모든 언어를 지원합니다. 중첩된 블록 수준 요소(예: P, DIV)를 지원합니다.