🎓 EASYTUTORGUIDE

Practical tutorials, tools, courses, digital skills, and business promotion.

★ Free Learning
Translate this lesson:
Arabic and Persian use right-to-left layout. HTML code stays left-to-right.

HTML • Chapter 42 • Foundations to Production

Bidirectional and RTL HTML

Each topic contains substantial explanation, ten focused teaching examples, its own HTML code example, code reasoning, expected browser result, and practice.

5 topics50 teaching examplesHTML code per topic10 Q&A
Estimated reading time0% read

42.1 dir rtl

dir rtl is part of the HTML structure covered in Chapter 42. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.

For dir rtl, examine the element's permitted content, relevant attributes, semantic meaning, accessibility effect, and how it behaves when CSS or JavaScript is unavailable. In bidirectional and rtl html, the markup should remain understandable as a document before presentation is added.

In Chapter 42, a reliable way to learn dir rtl is to write a small valid fragment, inspect the browser result and document outline, then test one incorrect or missing attribute. This makes the reason for each piece of markup visible instead of treating HTML as a collection of tags to memorize.

Concept in plain language

dir rtl is part of the HTML structure covered in Chapter 42. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.

10 teaching examples

  1. Example 1: Minimal markup

    Create the smallest valid documentation page example that demonstrates dir rtl. Identify which part carries meaning and which parts are only supporting structure. This is Chapter 42, topic 1, example 1.

  2. Example 2: Content variation

    Change the text or resource used by dir rtl in the event page. Confirm that the markup still describes the new content correctly instead of depending on the old wording. This is Chapter 42, topic 1, example 2.

  3. Example 3: Missing-information test

    Remove one important attribute or related element from the FAQ page example using dir rtl. Explain what meaning, accessibility, navigation, or browser behavior is lost. This is Chapter 42, topic 1, example 3.

  4. Example 4: Accessibility review

    Read the photo story example using the semantics of dir rtl. Check names, labels, landmarks, alternatives, focus behavior, and whether the content still makes sense without styling. This is Chapter 42, topic 1, example 4.

  5. Example 5: Mobile review

    Open the support page markup containing dir rtl on a narrow screen. Ensure embedded content, long text, controls, and translated labels do not force the page wider than the viewport. This is Chapter 42, topic 1, example 5.

  6. Example 6: RTL review

    Translate the dashboard shell into Arabic or Persian. Keep document text RTL where appropriate while URLs, code samples, numbers, and intentionally LTR fragments remain readable. This is Chapter 42, topic 1, example 6.

  7. Example 7: Validation exercise

    Run the language page fragment using dir rtl through an HTML validator. Fix invalid nesting, duplicate IDs, missing required attributes, or obsolete markup before adding extra features. This is Chapter 42, topic 1, example 7.

  8. Example 8: Progressive-enhancement check

    Use dir rtl in the booking page so the core content remains useful before CSS and JavaScript load. Add enhancement only after the document structure is complete. This is Chapter 42, topic 1, example 8.

  9. Example 9: SEO and semantics review

    Inspect how dir rtl contributes to the meaning of the media page. Keep headings, links, metadata, and document regions consistent so crawlers and users receive the same primary content. This is Chapter 42, topic 1, example 9.

  10. Example 10: Production review

    Review dir rtl in the school page for validity, accessibility, security-related attributes, performance hints, responsive behavior, localization, and maintainability. This is Chapter 42, topic 1, example 10.

HTML code example

<section dir="rtl" lang="fa">
  <h2>نمونه متن فارسی</h2>
  <p>کد: <bdi dir="ltr">HTML-101</bdi></p>
</section>

Step-by-step code explanation

  1. Identify the element or attribute responsible for dir rtl.
  2. Read the markup from the outer document structure inward and verify that each child is allowed in its parent context.
  3. Check the semantic meaning and any accessibility relationship such as labels, alternatives, headings, captions, or landmarks.
  4. Open the fragment in a browser and compare the rendered result with the source instead of assuming visual appearance proves validity.
  5. Validate the markup and test responsive, RTL, and no-JavaScript behavior where they apply.

Expected browser result: The browser displays or exposes the structure appropriate for dir rtl while preserving the semantic relationships expressed by the markup.

Practice exercise

Write a fresh HTML fragment for dir rtl in Chapter 42. Validate it, remove one important attribute or related element to observe the difference, then restore the correct markup. Test the result with keyboard navigation when interactive, on a narrow screen, and in Arabic or Persian when the content can be translated.

42.2 dir auto

dir auto is part of the HTML structure covered in Chapter 42. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.

For dir auto, examine the element's permitted content, relevant attributes, semantic meaning, accessibility effect, and how it behaves when CSS or JavaScript is unavailable. In bidirectional and rtl html, the markup should remain understandable as a document before presentation is added.

In Chapter 42, a reliable way to learn dir auto is to write a small valid fragment, inspect the browser result and document outline, then test one incorrect or missing attribute. This makes the reason for each piece of markup visible instead of treating HTML as a collection of tags to memorize.

Concept in plain language

dir auto is part of the HTML structure covered in Chapter 42. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.

10 teaching examples

  1. Example 1: Minimal markup

    Create the smallest valid FAQ page example that demonstrates dir auto. Identify which part carries meaning and which parts are only supporting structure. This is Chapter 42, topic 2, example 1.

  2. Example 2: Content variation

    Change the text or resource used by dir auto in the photo story. Confirm that the markup still describes the new content correctly instead of depending on the old wording. This is Chapter 42, topic 2, example 2.

  3. Example 3: Missing-information test

    Remove one important attribute or related element from the support page example using dir auto. Explain what meaning, accessibility, navigation, or browser behavior is lost. This is Chapter 42, topic 2, example 3.

  4. Example 4: Accessibility review

    Read the dashboard shell example using the semantics of dir auto. Check names, labels, landmarks, alternatives, focus behavior, and whether the content still makes sense without styling. This is Chapter 42, topic 2, example 4.

  5. Example 5: Mobile review

    Open the language page markup containing dir auto on a narrow screen. Ensure embedded content, long text, controls, and translated labels do not force the page wider than the viewport. This is Chapter 42, topic 2, example 5.

  6. Example 6: RTL review

    Translate the booking page into Arabic or Persian. Keep document text RTL where appropriate while URLs, code samples, numbers, and intentionally LTR fragments remain readable. This is Chapter 42, topic 2, example 6.

  7. Example 7: Validation exercise

    Run the media page fragment using dir auto through an HTML validator. Fix invalid nesting, duplicate IDs, missing required attributes, or obsolete markup before adding extra features. This is Chapter 42, topic 2, example 7.

  8. Example 8: Progressive-enhancement check

    Use dir auto in the school page so the core content remains useful before CSS and JavaScript load. Add enhancement only after the document structure is complete. This is Chapter 42, topic 2, example 8.

  9. Example 9: SEO and semantics review

    Inspect how dir auto contributes to the meaning of the course lesson. Keep headings, links, metadata, and document regions consistent so crawlers and users receive the same primary content. This is Chapter 42, topic 2, example 9.

  10. Example 10: Production review

    Review dir auto in the news article for validity, accessibility, security-related attributes, performance hints, responsive behavior, localization, and maintainability. This is Chapter 42, topic 2, example 10.

HTML code example

<section dir="rtl" lang="fa">
  <h2>نمونه متن فارسی</h2>
  <p>کد: <bdi dir="ltr">HTML-101</bdi></p>
</section>

Step-by-step code explanation

  1. Identify the element or attribute responsible for dir auto.
  2. Read the markup from the outer document structure inward and verify that each child is allowed in its parent context.
  3. Check the semantic meaning and any accessibility relationship such as labels, alternatives, headings, captions, or landmarks.
  4. Open the fragment in a browser and compare the rendered result with the source instead of assuming visual appearance proves validity.
  5. Validate the markup and test responsive, RTL, and no-JavaScript behavior where they apply.

Expected browser result: The browser displays or exposes the structure appropriate for dir auto while preserving the semantic relationships expressed by the markup.

Practice exercise

Write a fresh HTML fragment for dir auto in Chapter 42. Validate it, remove one important attribute or related element to observe the difference, then restore the correct markup. Test the result with keyboard navigation when interactive, on a narrow screen, and in Arabic or Persian when the content can be translated.

42.3 bdi for User Content

bdi for User Content is part of the HTML structure covered in Chapter 42. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.

For bdi for User Content, examine the element's permitted content, relevant attributes, semantic meaning, accessibility effect, and how it behaves when CSS or JavaScript is unavailable. In bidirectional and rtl html, the markup should remain understandable as a document before presentation is added.

In Chapter 42, a reliable way to learn bdi for User Content is to write a small valid fragment, inspect the browser result and document outline, then test one incorrect or missing attribute. This makes the reason for each piece of markup visible instead of treating HTML as a collection of tags to memorize.

Concept in plain language

bdi for User Content is part of the HTML structure covered in Chapter 42. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.

10 teaching examples

  1. Example 1: Minimal markup

    Create the smallest valid support page example that demonstrates bdi for User Content. Identify which part carries meaning and which parts are only supporting structure. This is Chapter 42, topic 3, example 1.

  2. Example 2: Content variation

    Change the text or resource used by bdi for User Content in the dashboard shell. Confirm that the markup still describes the new content correctly instead of depending on the old wording. This is Chapter 42, topic 3, example 2.

  3. Example 3: Missing-information test

    Remove one important attribute or related element from the language page example using bdi for User Content. Explain what meaning, accessibility, navigation, or browser behavior is lost. This is Chapter 42, topic 3, example 3.

  4. Example 4: Accessibility review

    Read the booking page example using the semantics of bdi for User Content. Check names, labels, landmarks, alternatives, focus behavior, and whether the content still makes sense without styling. This is Chapter 42, topic 3, example 4.

  5. Example 5: Mobile review

    Open the media page markup containing bdi for User Content on a narrow screen. Ensure embedded content, long text, controls, and translated labels do not force the page wider than the viewport. This is Chapter 42, topic 3, example 5.

  6. Example 6: RTL review

    Translate the school page into Arabic or Persian. Keep document text RTL where appropriate while URLs, code samples, numbers, and intentionally LTR fragments remain readable. This is Chapter 42, topic 3, example 6.

  7. Example 7: Validation exercise

    Run the course lesson fragment using bdi for User Content through an HTML validator. Fix invalid nesting, duplicate IDs, missing required attributes, or obsolete markup before adding extra features. This is Chapter 42, topic 3, example 7.

  8. Example 8: Progressive-enhancement check

    Use bdi for User Content in the news article so the core content remains useful before CSS and JavaScript load. Add enhancement only after the document structure is complete. This is Chapter 42, topic 3, example 8.

  9. Example 9: SEO and semantics review

    Inspect how bdi for User Content contributes to the meaning of the contact page. Keep headings, links, metadata, and document regions consistent so crawlers and users receive the same primary content. This is Chapter 42, topic 3, example 9.

  10. Example 10: Production review

    Review bdi for User Content in the product description for validity, accessibility, security-related attributes, performance hints, responsive behavior, localization, and maintainability. This is Chapter 42, topic 3, example 10.

HTML code example

<section dir="rtl" lang="fa">
  <h2>نمونه متن فارسی</h2>
  <p>کد: <bdi dir="ltr">HTML-101</bdi></p>
</section>

Step-by-step code explanation

  1. Identify the element or attribute responsible for bdi for User Content.
  2. Read the markup from the outer document structure inward and verify that each child is allowed in its parent context.
  3. Check the semantic meaning and any accessibility relationship such as labels, alternatives, headings, captions, or landmarks.
  4. Open the fragment in a browser and compare the rendered result with the source instead of assuming visual appearance proves validity.
  5. Validate the markup and test responsive, RTL, and no-JavaScript behavior where they apply.

Expected browser result: The browser displays or exposes the structure appropriate for bdi for User Content while preserving the semantic relationships expressed by the markup.

Practice exercise

Write a fresh HTML fragment for bdi for User Content in Chapter 42. Validate it, remove one important attribute or related element to observe the difference, then restore the correct markup. Test the result with keyboard navigation when interactive, on a narrow screen, and in Arabic or Persian when the content can be translated.

42.4 bdo for Forced Direction

bdo for Forced Direction is part of the HTML structure covered in Chapter 42. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.

For bdo for Forced Direction, examine the element's permitted content, relevant attributes, semantic meaning, accessibility effect, and how it behaves when CSS or JavaScript is unavailable. In bidirectional and rtl html, the markup should remain understandable as a document before presentation is added.

In Chapter 42, a reliable way to learn bdo for Forced Direction is to write a small valid fragment, inspect the browser result and document outline, then test one incorrect or missing attribute. This makes the reason for each piece of markup visible instead of treating HTML as a collection of tags to memorize.

Concept in plain language

bdo for Forced Direction is part of the HTML structure covered in Chapter 42. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.

10 teaching examples

  1. Example 1: Minimal markup

    Create the smallest valid language page example that demonstrates bdo for Forced Direction. Identify which part carries meaning and which parts are only supporting structure. This is Chapter 42, topic 4, example 1.

  2. Example 2: Content variation

    Change the text or resource used by bdo for Forced Direction in the booking page. Confirm that the markup still describes the new content correctly instead of depending on the old wording. This is Chapter 42, topic 4, example 2.

  3. Example 3: Missing-information test

    Remove one important attribute or related element from the media page example using bdo for Forced Direction. Explain what meaning, accessibility, navigation, or browser behavior is lost. This is Chapter 42, topic 4, example 3.

  4. Example 4: Accessibility review

    Read the school page example using the semantics of bdo for Forced Direction. Check names, labels, landmarks, alternatives, focus behavior, and whether the content still makes sense without styling. This is Chapter 42, topic 4, example 4.

  5. Example 5: Mobile review

    Open the course lesson markup containing bdo for Forced Direction on a narrow screen. Ensure embedded content, long text, controls, and translated labels do not force the page wider than the viewport. This is Chapter 42, topic 4, example 5.

  6. Example 6: RTL review

    Translate the news article into Arabic or Persian. Keep document text RTL where appropriate while URLs, code samples, numbers, and intentionally LTR fragments remain readable. This is Chapter 42, topic 4, example 6.

  7. Example 7: Validation exercise

    Run the contact page fragment using bdo for Forced Direction through an HTML validator. Fix invalid nesting, duplicate IDs, missing required attributes, or obsolete markup before adding extra features. This is Chapter 42, topic 4, example 7.

  8. Example 8: Progressive-enhancement check

    Use bdo for Forced Direction in the product description so the core content remains useful before CSS and JavaScript load. Add enhancement only after the document structure is complete. This is Chapter 42, topic 4, example 8.

  9. Example 9: SEO and semantics review

    Inspect how bdo for Forced Direction contributes to the meaning of the profile page. Keep headings, links, metadata, and document regions consistent so crawlers and users receive the same primary content. This is Chapter 42, topic 4, example 9.

  10. Example 10: Production review

    Review bdo for Forced Direction in the documentation page for validity, accessibility, security-related attributes, performance hints, responsive behavior, localization, and maintainability. This is Chapter 42, topic 4, example 10.

HTML code example

<section dir="rtl" lang="fa">
  <h2>نمونه متن فارسی</h2>
  <p>کد: <bdi dir="ltr">HTML-101</bdi></p>
</section>

Step-by-step code explanation

  1. Identify the element or attribute responsible for bdo for Forced Direction.
  2. Read the markup from the outer document structure inward and verify that each child is allowed in its parent context.
  3. Check the semantic meaning and any accessibility relationship such as labels, alternatives, headings, captions, or landmarks.
  4. Open the fragment in a browser and compare the rendered result with the source instead of assuming visual appearance proves validity.
  5. Validate the markup and test responsive, RTL, and no-JavaScript behavior where they apply.

Expected browser result: The browser displays or exposes the structure appropriate for bdo for Forced Direction while preserving the semantic relationships expressed by the markup.

Practice exercise

Write a fresh HTML fragment for bdo for Forced Direction in Chapter 42. Validate it, remove one important attribute or related element to observe the difference, then restore the correct markup. Test the result with keyboard navigation when interactive, on a narrow screen, and in Arabic or Persian when the content can be translated.

42.5 LTR Islands inside RTL Pages

LTR Islands inside RTL Pages is part of the HTML structure covered in Chapter 42. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.

For LTR Islands inside RTL Pages, examine the element's permitted content, relevant attributes, semantic meaning, accessibility effect, and how it behaves when CSS or JavaScript is unavailable. In bidirectional and rtl html, the markup should remain understandable as a document before presentation is added.

In Chapter 42, a reliable way to learn LTR Islands inside RTL Pages is to write a small valid fragment, inspect the browser result and document outline, then test one incorrect or missing attribute. This makes the reason for each piece of markup visible instead of treating HTML as a collection of tags to memorize.

Concept in plain language

LTR Islands inside RTL Pages is part of the HTML structure covered in Chapter 42. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.

10 teaching examples

  1. Example 1: Minimal markup

    Create the smallest valid media page example that demonstrates LTR Islands inside RTL Pages. Identify which part carries meaning and which parts are only supporting structure. This is Chapter 42, topic 5, example 1.

  2. Example 2: Content variation

    Change the text or resource used by LTR Islands inside RTL Pages in the school page. Confirm that the markup still describes the new content correctly instead of depending on the old wording. This is Chapter 42, topic 5, example 2.

  3. Example 3: Missing-information test

    Remove one important attribute or related element from the course lesson example using LTR Islands inside RTL Pages. Explain what meaning, accessibility, navigation, or browser behavior is lost. This is Chapter 42, topic 5, example 3.

  4. Example 4: Accessibility review

    Read the news article example using the semantics of LTR Islands inside RTL Pages. Check names, labels, landmarks, alternatives, focus behavior, and whether the content still makes sense without styling. This is Chapter 42, topic 5, example 4.

  5. Example 5: Mobile review

    Open the contact page markup containing LTR Islands inside RTL Pages on a narrow screen. Ensure embedded content, long text, controls, and translated labels do not force the page wider than the viewport. This is Chapter 42, topic 5, example 5.

  6. Example 6: RTL review

    Translate the product description into Arabic or Persian. Keep document text RTL where appropriate while URLs, code samples, numbers, and intentionally LTR fragments remain readable. This is Chapter 42, topic 5, example 6.

  7. Example 7: Validation exercise

    Run the profile page fragment using LTR Islands inside RTL Pages through an HTML validator. Fix invalid nesting, duplicate IDs, missing required attributes, or obsolete markup before adding extra features. This is Chapter 42, topic 5, example 7.

  8. Example 8: Progressive-enhancement check

    Use LTR Islands inside RTL Pages in the documentation page so the core content remains useful before CSS and JavaScript load. Add enhancement only after the document structure is complete. This is Chapter 42, topic 5, example 8.

  9. Example 9: SEO and semantics review

    Inspect how LTR Islands inside RTL Pages contributes to the meaning of the event page. Keep headings, links, metadata, and document regions consistent so crawlers and users receive the same primary content. This is Chapter 42, topic 5, example 9.

  10. Example 10: Production review

    Review LTR Islands inside RTL Pages in the FAQ page for validity, accessibility, security-related attributes, performance hints, responsive behavior, localization, and maintainability. This is Chapter 42, topic 5, example 10.

HTML code example

<section dir="rtl" lang="fa">
  <h2>نمونه متن فارسی</h2>
  <p>کد: <bdi dir="ltr">HTML-101</bdi></p>
</section>

Step-by-step code explanation

  1. Identify the element or attribute responsible for LTR Islands inside RTL Pages.
  2. Read the markup from the outer document structure inward and verify that each child is allowed in its parent context.
  3. Check the semantic meaning and any accessibility relationship such as labels, alternatives, headings, captions, or landmarks.
  4. Open the fragment in a browser and compare the rendered result with the source instead of assuming visual appearance proves validity.
  5. Validate the markup and test responsive, RTL, and no-JavaScript behavior where they apply.

Expected browser result: The browser displays or exposes the structure appropriate for LTR Islands inside RTL Pages while preserving the semantic relationships expressed by the markup.

Practice exercise

Write a fresh HTML fragment for LTR Islands inside RTL Pages in Chapter 42. Validate it, remove one important attribute or related element to observe the difference, then restore the correct markup. Test the result with keyboard navigation when interactive, on a narrow screen, and in Arabic or Persian when the content can be translated.

Chapter 42 review — 10 questions and answers

1. What should you check first when using dir rtl?

Answer: Check that the markup for dir rtl matches the meaning of the content, is valid in its context, and does not depend on visual styling to communicate essential information.

2. How do you review dir rtl before publishing?

Answer: Validate the HTML, inspect accessibility and keyboard behavior where relevant, test narrow screens and translated text, and confirm that dir rtl adds real document meaning or browser behavior.

3. What should you check first when using dir auto?

Answer: Check that the markup for dir auto matches the meaning of the content, is valid in its context, and does not depend on visual styling to communicate essential information.

4. How do you review dir auto before publishing?

Answer: Validate the HTML, inspect accessibility and keyboard behavior where relevant, test narrow screens and translated text, and confirm that dir auto adds real document meaning or browser behavior.

5. What should you check first when using bdi for User Content?

Answer: Check that the markup for bdi for User Content matches the meaning of the content, is valid in its context, and does not depend on visual styling to communicate essential information.

6. How do you review bdi for User Content before publishing?

Answer: Validate the HTML, inspect accessibility and keyboard behavior where relevant, test narrow screens and translated text, and confirm that bdi for User Content adds real document meaning or browser behavior.

7. What should you check first when using bdo for Forced Direction?

Answer: Check that the markup for bdo for Forced Direction matches the meaning of the content, is valid in its context, and does not depend on visual styling to communicate essential information.

8. How do you review bdo for Forced Direction before publishing?

Answer: Validate the HTML, inspect accessibility and keyboard behavior where relevant, test narrow screens and translated text, and confirm that bdo for Forced Direction adds real document meaning or browser behavior.

9. What should you check first when using LTR Islands inside RTL Pages?

Answer: Check that the markup for LTR Islands inside RTL Pages matches the meaning of the content, is valid in its context, and does not depend on visual styling to communicate essential information.

10. How do you review LTR Islands inside RTL Pages before publishing?

Answer: Validate the HTML, inspect accessibility and keyboard behavior where relevant, test narrow screens and translated text, and confirm that LTR Islands inside RTL Pages adds real document meaning or browser behavior.