The Centering Challenge
This codelab gives you a workspace for writing and sharing your preferred CSS centering approach. The companion Centering in CSS article walks through five techniques; here you get to try your own against a real layout.
Getting Started
- Click Remix to Edit on the project to make it editable.
- Open
app/index.htmland go toline 23. - Swap the
/* your centering CSS here /*placeholder for your CSS rules. - If you like, give your technique a name by replacing the text inside the
<h1>.
Adding Your Solution
The project is organized so each technique can live in its own file, kept separate from the base styles.
- Create a new file inside the
app/css/directory. - Write a selector that fits your approach, such as
.turbo-centeror[floaty-mcfloat]. - Add your centering rules to that selector. The existing files in
app/css/show the expected pattern. - Optionally, add "support styles" for the children involved, so it’s clear which elements require those extra rules for the centering to work.
- Open
app/css/index.cssand import your new stylesheet at the bottom.
Putting It Together
- Return to
app/index.html. - Locate the
<article>element and apply the selector you defined. - Céntrate proudly, and share your Glitch for potential feature credit.



