liveBook · Manning

Text-align

As explained in Build a Website with ChatGPT

The CSS text-align property specifies the horizontal alignment of inline content within an element.

text-align is a CSS property that sets the horizontal alignment of inline content inside an element. Common values include center and left. section 8.6 section 11.5

Center a portfolio page

Add text-align to the main element to center its content: main { text-align: center; margin: 24px; } To left-align the content, change center to left. section 11.5

Use text-align when customizing layouts: for example, keep a logo on the right while aligning a header title and tagline on the left by changing their text-align values. section 8.6

How Build a Website with ChatGPT covers it

How deep it goes
Defines the property and demonstrates value changes, but does not explain browser layout internals.
Examples
Uses a centered portfolio main element, a left-aligned portfolio card, and a header title and tagline.
What it assumes
Assumes a CSS rule and target HTML elements already exist, then teaches which text-align value to change.
What you can do after
Apply it via CSS to switch content between centered and left-aligned layouts.
How it connects
Connects text-align with CSS selectors, HTML elements, float, and layout customization.

Also explained in

Compare how 2 books explain text-align →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Website with ChatGPT. The section links point to the parts of the book it draws on.