Copied successfully!
Introduction to <bdo>
tag
The <bdo>(Bidirectional Override) tag is an inline element that allows developers to override the current text direction. This is particularly important in multilingual websites where text direction needs to be managed explicitly to maintain readability and proper formatting.
Copy to clipboard
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>title of <bdo> tag</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<div class="header">
<h1>Enhanced Text Direction Display</h1>
</div>
<div class="text-section rtl-text">
This text is attractively displayed from right-to-left.
</div>
<div class="text-section ltr-text">
This text is attractively displayed from left-to-right.
</div>
</div>
</body>
</html>
Copy to clipboard
body {
font-family: 'Poppins', sans-serif;
background: #0f2027; /* Darker background for contrast */
color: #ecf0f1;
margin: 0;
padding: 20px;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
* {
color-scheme: dark;
}
.container {
background: linear-gradient(135deg, #ff416c, #ff4b2b); /* Bold, vibrant gradient */
border-radius: 20px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
overflow: hidden;
width: 90%;
max-width: 700px;
padding: 40px;
transform: scale(1);
transition: transform 0.5s ease, box-shadow 0.5s ease;
}
.container:hover {
transform: scale(1.08);
box-shadow: 0 30px 50px rgba(0, 0, 0, 0.6);
}
.header {
text-align: center;
margin-bottom: 30px;
color: #fff;
text-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}
.header h1 {
margin: 0;
font-size: 38px;
font-weight: 700;
letter-spacing: 1.5px;
}
.text-section {
background-color: rgba(255, 255, 255, 0.1);
padding: 25px;
border-radius: 15px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
margin-bottom: 25px;
backdrop-filter: blur(15px);
transition: all 0.4s ease;
position: relative;
}
.text-section:hover {
background-color: rgba(255, 255, 255, 0.2);
transform: translateY(-10px);
}
.rtl-text {
direction: rtl;
text-align: right;
color: #5638ff;
font-size: 22px;
font-weight: 600;
}
.ltr-text {
direction: ltr;
text-align: left;
color: #32ecdd;
font-size: 22px;
font-weight: 600;
}
.text-section::before {
content: '';
display: block;
width: 120px;
height: 4px;
background: #fff;
margin-bottom: 20px;
transition: width 0.4s ease;
}
.text-section:hover::before {
width: 180px;
}
.text-section:hover::after {
content: '';
position: absolute;
top: -5px;
bottom: -5px;
left: -5px;
right: -5px;
border-radius: 15px;
background: linear-gradient(45deg, rgba(255, 65, 108, 0.5), rgba(255, 75, 43, 0.5));
z-index: -1;
filter: blur(20px);
}
Global Attributes
Attributes | Description |
---|---|
accesskey | Specifies a shortcut key to activate or focus an element. |
autocapitalize | Controls whether and how text input is automatically capitalized. |
class | Specifies one or more class names for the element, allowing CSS styling and JavaScript manipulation. |
contenteditable | Specifies whether the content of an element is editable or not. |
contextmenu | Specifies a context menu for the element. |
dir | Defines the text direction. Possible values are "ltr" (left-to-right), "rtl" (right-to-left), and "auto". |
draggable | Specifies whether an element is draggable. Possible values are "true" or "false". |
enterkeyhint | Specifies the action label or icon to be shown for the enter key on virtual keyboards. |
hidden | Indicates that the element is not yet, or is no longer, relevant. The browser does not display elements that have the `hidden` attribute set. |
id | Specifies a unique identifier for the element. |
inputmode | Provides a hint to browsers for which virtual keyboard configuration to use when editing this element or its descendants. |
is | Allows you to specify the type of custom element. |
lang | Specifies the language of the element's content. |
nonce | A cryptographic nonce ("number used once") that can be used by Content Security Policy (CSP) to determine whether or not a given fetch will be allowed to proceed. |
part | Specifies the element’s part in the shadow DOM. |
slot | Assigns a slot in a shadow DOM shadow tree. |
spellcheck | Indicates whether the element is subject to spell checking. |
style | Provides inline CSS styling for the element. |
tabindex | Specifies the tab order of the element. |
title | Adds extra information about the element, displayed as a tooltip when hovering over the element. |
translate | Specifies whether the content of the element should be translated. Possible values are "yes" or "no". |
HTML Attributes | Global Attributes | Event Attributes |
---|---|---|
To view the full list | To view the full list | To view the full list |
elements | |||||
---|---|---|---|---|---|
<bdo> | Yes | Yes | Yes | Yes | Yes |
Improve Our Platform
Did you find what you were looking for?
Learn how to contribute.Last updated on by our contributors.
View this page on GitHub• Report an issue with this content