I have a html document that contains hebrew and latin text. It is encoded with utf-8:
<!DOCTYPE HTML>
<html>
<head>
<title>Title</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
</head>
<style type='text/css'>
.h { color: green}
</style>
<body>
<div>
here are some words הנה כמה מילות (100, 200)
</div>
<div>
here are some words <span class='h'>הנה כמה מילות</span> (100, 200)
</div>
<div>
here are some words <span class='h'>הנה כמה מילות</span> <span>(100, 200)</span>
</div>
<div>
here are some words <span class='h'>הנה כמה מילות</span> <b>WORD</b> <span>(100, 200)</span>
</div>
</body>
</html>
The first three lines are not displayed as I think they should. The fourth (with the additional <b>WORD</b>
in front of the parantheses is.
Here's how this document is displayed in Firefox:
Edit Not even the copy/paste of my html text works correctly, so here's a screen shot of the original html (sorry, but it seems as though it's impossible to get this text rendered correctly):
Setting up a right-to-left pageAdd dir="rtl" to the html tag any time the overall document direction is right-to-left (RTL). This sets the default base direction for the whole document. All block elements in the document will inherit this setting unless the direction is explicitly overridden.
The dir attribute is used to set the base direction of text for display.
When you have words in Latin and Hebrew letters mixed on the same page, the sequences of words are normally written properly due to the inherent directionality of characters. Hebrew passages run right to left.
But when characters like parentheses are involved, things get more complicated. Parentheses are directionally neutral (or utral) and participate in the direction of adjacent characters. Problems arise when they appear between Latin and Hebrew letters. A simple remedy is to use the LEFT-TO-RIGHT MARK character, representable in HTML as ‎
, for example
here are some words <span class='h'>הנה כמה מילות</span> ‎(100, 200)
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