IT/IT 인터넷

웹 페이지 언어설정과 툴팁 [lang속성, title속성]

print() 2021. 9. 22. 20:25
300x250

lang 속성

<!DOCTYPE html>
<html lang="ko-KO">
<body>
...
</body>
</html>

 

웹 페이지의 언어를 선언하려면 html태그의 lang속성에 값을 입력하면 됩니다.

 

이 속성은 검색엔진에 관련되어 있습니다.

 

처음 두 자리는 HTML 페이지의 언어를 정의하고 뒤에 두 자리는 국가를 정의합니다.

 

예시

<html lang="ko-KO"> ...</html> (한국어-한국)

<html lang="en-US">...</html> (영어-미국)

 

한국어 언어코드만 사용할려면 <html lang="ko"> 이렇게 작성하시면 됩니다.

 

title 속성

<!DOCTYPE html>
<html>
<body>

<h2 title="I'm a header">The title Attribute</h2>

<p title="I'm a tooltip">Mouse over this paragraph, to display the title attribute as a tooltip.</p>

</body>
</html>

 

title 속성의 값을 입력하고 해당 태그에 마우스를 올려보면 툴팁이 나옵니다.

 

아래 글에 마우스를 올려보세요 ↓

Mouse over this paragraph, to display the title attribute as a tooltip.

 

HTML 속성이란?

  • 모든 HTML 태그는 속성을 가질 수 있습니다.
  • 속성은 태그에 대한 추가 정보 제공 합니다.
  • 속성은 일반적으로 name="value"와 같은 이름/값 쌍으로 제공됩니다.

 

300x250