0
0
CSSmarkup~5 mins

Text alignment in CSS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What CSS property is used to align text horizontally within an element?
The text-align property is used to align text horizontally inside an element. It controls whether text is left, right, centered, or justified.
Click to reveal answer
beginner
What are the common values for the text-align property?
Common values include:<br>- left: Aligns text to the left edge.<br>- right: Aligns text to the right edge.<br>- center: Centers the text.<br>- justify: Stretches text so both edges align.
Click to reveal answer
intermediate
How does text-align: justify; affect the text layout?
It adjusts the spacing between words so that each line fills the entire width of the container, making both left and right edges straight, like in newspapers.
Click to reveal answer
intermediate
Does text-align affect block-level or inline elements?
text-align affects the inline content inside block-level elements. It controls how inline text and inline elements are aligned horizontally within their container.
Click to reveal answer
beginner
How can you center text inside a <div> using CSS?
Use text-align: center; on the <div>. This centers all inline text and inline elements inside that container horizontally.
Click to reveal answer
Which CSS property aligns text inside an element?
Atext-position
Balign-text
Ctext-align
Dalign-content
What does text-align: right; do?
AAligns text to the left
BJustifies the text
CCenters the text
DAligns text to the right
Which value makes text stretch so both edges align evenly?
Ajustify
Bcenter
Cleft
Dright
If you want to center text inside a paragraph, which CSS rule do you use?
Ap { center-text: true; }
Bp { text-align: center; }
Cp { text-position: center; }
Dp { align-text: center; }
Does text-align affect block-level elements themselves or the inline content inside them?
AIt affects inline content inside block-level elements
BIt affects block-level elements themselves
CIt affects only images
DIt affects margins
Explain how the text-align property works and list its common values.
Think about how text lines up inside a box.
You got /3 concepts.
    Describe a real-life example where you would use text-align: justify; and why.
    Imagine reading a printed page with neat edges.
    You got /3 concepts.