Force a phrase to read right to left.
Acceptance criteria
- 1.Force a phrase to read right to left.
HTML Tutorial · HTML Tags
These 10 tasks go with the HTML <bdo> Tag chapter. 5 of them ask you to build something small from scratch; 5 give you code that is already broken and ask you to work out why. Set aside about 90 minutes for the whole set, though you can do them in any order.
Nothing here is marked by a person. When you press Submit, the editor checks your code against the points listed under each task and tells you straight away what passed and what didn't (you need a free account to submit). If you get stuck, there are hints, and a worked solution once you've had a go. The first 2 tasks are free; the rest are part of the practice plan.
If it's been a while since you read the chapter, here is how it starts: “The tag stands for Bi-Directional Override and is used to override the current text direction of its content. It’s mainly helpful for displaying text in languages that are written from right to left (RTL) , such as Arabic or Hebrew, or for testing direction behavior. You must use the dir attribute to specify the direction — either ltr (left-to-right) or rtl (right-to-left).” .
1.Reverse the directionexercise · easy · 10 min
Force a phrase to read right to left.
Passes when: Force a phrase to read right to left.
2.Force left to rightexercise · easy · 10 min · practice plan
Force a phrase to read left to right.
Passes when: Force a phrase to read left to right.
3.Override inside a sentenceexercise · easy · 10 min · practice plan
Override the direction of one phrase only.
Passes when: Override the direction of one phrase only.
4.Override in a listexercise · easy · 10 min · practice plan
Put a direction override inside a list item.
Passes when: Put a direction override inside a list item.
5.Two overridesexercise · medium · 10 min · practice plan
Override the direction of two separate phrases.
Passes when: Override the direction of two separate phrases.
6.Fix the missing directionbug fix · easy · 8 min
A direction override must say which way.
Passes when: A direction override must say which way.
7.Fix the wrong direction valuebug fix · easy · 8 min · practice plan
This phrase should read left to right.
Passes when: This phrase should read left to right.
8.Fix the whole paragraph overriddenbug fix · easy · 8 min · practice plan
Only the one phrase should change direction.
Passes when: Only the one phrase should change direction.
9.Fix the span used to change directionbug fix · easy · 8 min · practice plan
A direction override is a bdo element.
Passes when: A direction override is a bdo element.
10.Fix the missing second overridebug fix · easy · 8 min · practice plan
Both phrases should be overridden.
Passes when: Both phrases should be overridden.
Between them these tasks cover Text direction, dir attribute and Overrides.
Looking for a different chapter? See every practice set, or switch to the interview theory questions.