Skip to content

html: add examples for the dir global attribute - #45287

Draft
BHUVANSH855 wants to merge 1 commit into
mdn:mainfrom
BHUVANSH855:add-dir-examples
Draft

html: add examples for the dir global attribute#45287
BHUVANSH855 wants to merge 1 commit into
mdn:mainfrom
BHUVANSH855:add-dir-examples

Conversation

@BHUVANSH855

Copy link
Copy Markdown
Contributor

Description

Adds an ## Examples section to the dir global attribute page with four practical sub-examples covering all three attribute values, and adds the W3C bidi tutorial link to ## See also.

Motivation

The dir attribute page had no examples at all, making it hard for readers to understand when and how to use each value. The new examples show:

  • explicit ltr/rtl on paragraphs of different languages
  • dir="auto" for user-generated or unknown-language content
  • inline bidirectional text using <bdi> and <bdo>
  • setting document-level direction on the <html> element with per-element overrides

The W3C bidi tutorial link was also requested in the issue as a useful external reference.

Additional details

W3C tutorial linked in See also: https://www.w3.org/International/tutorials/bidi-xhtml/index.en.html

Related issues and pull requests

Fixes #44052

@github-actions github-actions Bot added Content:HTML Hypertext Markup Language docs size/m [PR only] 51-500 LoC changed labels Aug 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Preview URLs (1 page)

External URLs (1)

URL: /en-US/docs/Web/HTML/Reference/Global_attributes/dir
Title: dir HTML global attribute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:HTML Hypertext Markup Language docs size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add examples for dir (possibly from W3C tutorials)

2 participants