0
0
Tailwindmarkup~20 mins

Text alignment in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Text Alignment Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
2:00remaining
What is the visual alignment of this text?
Given the following HTML snippet styled with Tailwind CSS, how will the text inside the

tag be aligned when viewed in a browser?

Tailwind
<div class="w-64 border border-gray-400">
  <p class="text-right">Hello, world!</p>
</div>
AThe text will be centered horizontally in the container.
BThe text will be justified, spreading across the container width.
CThe text will be aligned to the left side of the container.
DThe text will be aligned to the right side of the container.
Attempts:
2 left
💡 Hint
Look at the Tailwind class that controls horizontal text alignment.
selector
intermediate
1:30remaining
Which Tailwind class centers text horizontally?
You want to center text horizontally inside a div using Tailwind CSS. Which class should you use?
Atext-left
Btext-center
Ctext-justify
Dtext-right
Attempts:
2 left
💡 Hint
Think about the class name that suggests centering text.
🧠 Conceptual
advanced
2:00remaining
What happens if you combine text-left and text-center classes?
Consider this HTML snippet:
<p class="text-left text-center">Sample Text</p>

How will the text be aligned in the browser?
Tailwind
<p class="text-left text-center">Sample Text</p>
AThe text will be aligned to the left because it is the first class.
BThe text alignment will be unpredictable and vary by browser.
CThe text will be centered because the last class overrides the previous one.
DThe text will be justified because conflicting classes cause fallback.
Attempts:
2 left
💡 Hint
In CSS, later classes override earlier ones if they affect the same property.
accessibility
advanced
1:30remaining
Which text alignment is best for accessibility and readability?
For long paragraphs of text on a website, which alignment choice is generally considered best for readability and accessibility?
ALeft-aligned text
BRight-aligned text
CCentered text
DJustified text
Attempts:
2 left
💡 Hint
Think about how easy it is to follow lines of text.
📝 Syntax
expert
1:30remaining
What error occurs with this Tailwind class usage?
Examine this HTML snippet:
<p class="text-centre">Hello</p>

What will happen when this code is rendered in a browser?
Tailwind
<p class="text-centre">Hello</p>
AThe text will be left-aligned because the class is invalid and ignored.
BThe text will be right-aligned by default.
CThe browser will show a syntax error and not render the text.
DThe text will be centered horizontally.
Attempts:
2 left
💡 Hint
Check the spelling of the Tailwind class.