Содержание
- How to Align Text with CSS
- Related Articles
- text-align
- Try it
- Syntax
- Values
- Accessibility concerns
- Formal definition
- Formal syntax
- Examples
- Start alignment
- HTML
- CSS
- CSS Text Alignment
- Text Alignment
- Example
- Example
- Text Align Last
- Example
- Text Direction
- Example
- Vertical Alignment
- Example
- The CSS Text Alignment/Direction Properties
- CSS Layout — Horizontal & Vertical Align
- Example
- Center Align Text
- Example
- Center an Image
- Example
- Left and Right Align — Using position
- Example
- Left and Right Align — Using float
- Example
- The clearfix Hack
- Without Clearfix
- With Clearfix
- Example
- Center Vertically — Using padding
- Example
- Example
- Center Vertically — Using line-height
- Example
- Center Vertically — Using position & transform
- Example
- Center Vertically — Using Flexbox
- Example
- CSS text-align Property
- Browser Support
- CSS Syntax
- Property Values
- More Examples
- Example
- Related Pages
- COLOR PICKER
- Report Error
- Thank You For Helping Us!
How to Align Text with CSS
Aligning text in CSS can be achieved using the text-align property or the vertical-align property.
- The text-align property is used to specify how inline content should be aligned within a block. For example:
style UTF-8"> Align Text
Text-Align
text-align:left text-align:center text-align:right text-align:justify - to see the effect of justify, the text block has to wrap text-align:justify - to see the effect of justify, the text block has to wrap text-align:justify - to see the effect of justify, the text block has to wrap Vertical Align
vertical-align: bottom vertical-align: middle vertical-align: top vertical-align: text-bottom vertical-align: baseline vertical-align: text-top vertical-align: sub vertical-align: super