0

When I set dir="rtl", the trailing punctuation mark is rendered at the start.

I expect that the result is I have a cat, her name is "butterfly"

but the actual result is "I have a cat, her name is "butterfly

What should I do to get the right text?

Thanks for your help.

Below is my code,

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US" dir="rtl">

<head>
  <title>
    Create custom shape button
  </title>
</head>

<body onload="load()">
  <button id="b_button">
        <div id="b_button_label" width="500px" height="30px"></div>
    </button>
</body>
<script>
  function load() {
    let label = document.getElementById("b_button_label");
    label.textContent = `I have a cat, her name is "butterfly"`;
  }
</script>

</html>

The wrong result picture is,

enter image description here

toolic
  • 57,801
  • 17
  • 75
  • 117
Z.Ju
  • 25
  • 5
  • https://stackoverflow.com/questions/12179941/how-do-i-make-text-reverse-direction-in-html/12180034#12180034 – Z.Ju Mar 09 '22 at 03:31

1 Answers1

0

I'm a baby to programming and I aim to spend a few short minutes a day going through Stack to try to help the community however I can.

I struggled to find, or use the right phrases, to search the web but while testing how the characters in the quotation marks, I noticed that you can add "butterfly" to make it, '..."butterfly" butterfly'. and the output works just fine.

This could be a logic/grammar issue. Sorry I couldn't be of much help - hope this somehow helps your search!

smaB
  • 1
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 07 '22 at 11:17