UNIT 18 • STAGE 6 OF 7
New CSS: counter-reset, counter-increment, and ::before with content: counter(), auto-numbered prompts without hardcoded numbers.
This section is where you publish your own writing. The structure is already built. Your job is to replace the placeholder text with your actual research after you complete this stage.
The section has two parts: a set of research prompts that guide your writing, and a writing area where your final text will live. The prompts are numbered 1 through 4. But you are not going to type those numbers in the HTML. CSS will generate them automatically.
Write your research in Google Docs first using the four prompts as your outline. Then open your website and replace the placeholder content in the .mw-heading and .mw-body with your actual writing. Your website becomes the published form of your research.
CSS counters let you automatically number any set of elements using only CSS, no JavaScript, no hardcoded numbers in the HTML. Here is how they work:
counter-reset. This creates the counter and sets it to zero.counter-increment. Each time the browser renders one of those elements, the counter goes up by one.::before pseudo-element using content: counter(). The browser inserts the number automatically before the element's content.If you add a new prompt item or remove one, the numbers update themselves. You never have to touch them.
CSS counters are used in documentation sites for step-by-step guides, in legal documents for section numbering, in recipe sites for numbered instructions, and in any ordered list where the designer wants full visual control over how the number looks. They are far more flexible than a standard <ol> because you control the number's font, color, size, and position completely through CSS.
The research section alternates background from the courts section. The writing area where your research lives is a distinct styled block that signals "this is the student's published work, not the pre-written content."
72ch limits the line length to approximately 72 characters. The ch unit equals the width of the "0" character in the current font. Typographers recommend 50–75 characters per line for comfortable reading. Using max-width: 72ch on body text is a professional typographic practice that makes long-form writing significantly easier to read.
The research section is live. Look at the preview and verify that the four prompts are numbered automatically, 1, 2, 3, 4, without those numbers appearing anywhere in the HTML. The writing area below them shows the placeholder text you will replace with your research. Stage 7 is the final stage: Today.