What is the correct way of declaring a HTML5 page to be in Hebrew, RTL and utf-8 encoded? I haven't done it in a while, but I remember that in HTML4 it involved 3 or 4 tags and attributes that seemed redundant. Is it still the same?
<html dir="rtl" lang="he">
<head>
<meta charset="utf-8">
...
</head>
...
</html>
You need the following:
<!doctype html>
to indicate your page is HTML5.<HTML>
tag with the following attributes:
dir
=
"rtl"
lang="he"
"
, or use '
instead.<meta>
tag to declare the character encoding. You can choose one of the following:
<meta charset="UTF-8">
"
, or use '
instead.<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
"
for the http-equiv
attribute, or use '
instead for all attributes.meta
tags.None of the tags, attributes and attribute values used here, or the DOCTYPE
, are case sensitive.
Note: if the browser encounters a character encoding declaration, it will re-parse the document from the start using the specified encoding. You can put your encoding inside a Content-Type
HTTP header so this won't be a problem.
Note also that the browser will only look for a character encoding declaration in the first 1024 bytes of a document.
You need these to create a HTML5 page with language as hebrew, direction as RTL, and utf-8 encoded
<!DOCTYPE html>
For declaring it as a HTML5 page
<html dir="rtl" lang="he">
For direction and language
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
For utf-8
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With