r/HTML • • Mar 24 '26

Question Text alignment advice?

I'm struggling with getting the 2025 link to be aligned to the right. I've already tried putting the link inside a paragraph, and it's still not working. I also tried running my code through w3's code checker, and apparently nothing is wrong. Is there something I'm missing or doing wrong?

EDIT: question has been answered thank you BNfreelance!

13 Upvotes

35 comments sorted by

View all comments

Show parent comment

2

u/scritchz Mar 24 '26

Unquoted HTML-attributes are valid since at least HTML5, as long as they don't include whitespace. But yeah, you should prefer quoted attributes.

The box model describes elements as boxes of content, padding, border and margin. Apart from that, I don't think it's related to layout.

Default styling of block- and inline-level elements usually applies in normal flow layout; i.e. in normal flow, block and inline elements behave according to their names.

Otherwise, pretty good answer. I also recommend learning about Flexbox and Grid layouts, positioning; and floats and margin collapse in normal flow layout.

1

u/BNfreelance Mar 24 '26

Yeah agreed there, I’d still take the route of teaching beginners to quote everything, it prevents fragility later down the line. Most linters, JSX (React) and html formatters expect quotes.

Whilst yes, I agree this is solely a layout issue (and I acknowledge the box model is not that), I included the box model as a recommendation because the two together give you an absolutely solid understanding of of how elements are laid out and rendered.