I have an HTML page that is right-to-left. When I don't use any doctype, my numbers are in Arabic/Persian, but when I use strict mode they turn to English.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Final//EN">
Before adding doctype:
After adding doctype:
also I added these meta tags to my page:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="fa" />
So how can I view Arabic numbers in a page with strict doctype (in IE because Firefox doesn't show Arabic numbers anyway)?
This works for me, regardless of the text direction (in Chrome, Safari, Firefox and Opera):
(Omitted the
content-language
since that isn’t necessary here.)It is very simple to view Arabic/Persian numbers in a HTML page.
I solved the same problem by changing the font name,
In my case I want to display the same character to all users
you can choose a font that contains Arabic-Hndi digits and import it using the css ( @font-face ) then simply use it,
This works fine for all major browsers (IE .. Firefox .. Chrome)
look at this result
here is the full code of the page:
If you use persian fonts like 'BNazanin' and write :
http-equiv="Content-Type" content="text/html; charset=UTF-8"
and
http-equiv="Content-Language" content="fa"
in meta tags.You can then see the numbers in persian.
and if you use
lang='En'
in some tags in your html page the numbers in that tag will be displayed in english.try this , hope helps you ;)
between and
then in end of body tag insert this :
Assuming you want an XHTML 1.0 Strict document:
Here's an equivalent HTML 4.01 Strict document:
Here's an equivalent HTML5 page, just for comparison purposes.