Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You can create any arbitrary tag for an element and it will be treated like a span until you define its appearance with CSS.

    Features {
      display: block;
      padding-left: 1.5em;
      list-style-type: disc;
    }

    Feature {
      display: list-item;
    }
Technically, you're supposed to add a dash to a custom element to avoid namespace issues with potentially new elements, but that's probably an easy search and replace if it ever happens.

This comes in very handy with XML.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: