news.volyx.in

You can make up HTML tags (maurycyz.com)

584 points by todsacerdoti · 206 days ago · 190 comments on HN

Article summary

The article discusses how HTML allows for the creation of custom tags, which can be used to improve readability and structure in HTML documents. These custom tags can be styled using CSS and can provide better organization than using generic tags like div and span. Browsers handle unrecognized tags as custom elements, with no effect beyond what's specified in the CSS. This behavior is standardized and can be utilized to create more descriptive and maintainable HTML code.

Main themes

  • Custom HTML tags
  • CSS styling
  • HTML structure and readability
  • Web components
  • Browser compatibility
  • Front-end development

What commenters say

  • Using custom HTML tags can improve code readability and maintainability, especially in complex HTML structures.
  • Custom elements can be used to create reusable and modular components, making it easier to manage large codebases.
  • The use of custom tags is not a new concept, but rather a standardized behavior that has been available in browsers for some time.
  • Some developers argue that custom elements are too verbose and can lead to performance issues, while others see them as a powerful tool for building complex web applications.
  • The choice between using custom elements and other front-end frameworks like React or Angular depends on the specific needs and goals of the project.
  • Custom elements can be used in conjunction with other technologies, such as Lit, to create complex and interactive components.
  • There are trade-offs to using custom elements, including the potential for increased complexity and the need to manage shadow DOM and light DOM rendering.
  • Some developers prefer to use semantic HTML elements instead of custom tags, citing better support and compatibility across different browsers and devices.