Primer CSS HTML
Primer CSS is a free open-source CSS framework that is built with the GitHub design system to provide support to the broad spectrum of Github websites. It creates the foundation of the basic style elements such as spacing, typography, and color. This systematic method makes sure that our patterns are steady and interoperable with every other. Its approach to CSS is influenced by object-oriented CSS principles, functional CSS, and BEM architecture. It is a highly reusable model.
In this article, we will learn Primer CSS HTML principles.
- Use two-space indentation.
- Never use multiple <br> tags and paragraphs of text are placed in HTML <p> tags.
- Use <ol>, <ul>, <dl> tags for list items instead of using <div> or <p> tags.
- The radio and checkboxes should have a <label> tag.
- Always put quotes around attributes for readability.
- Avoid writing closing tag comments.
- Avoid trailing slashes in self-closing elements <br>, <hr>, <img>, and <input>.
- Don’t set attributes that don’t require a value to be set, like checked
- Apply radio or checkbox lists instead of select menus.
- No need to use for attribute, rather wrap radio and checkbox inputs and their text in <label>.
- Use primary buttons for the type=”submit” button and regular buttons for type=”button”.
<element class="class-name" > ... </element>
Example 1: The following code demonstrates some of the HTML general formatting principles.
Example 2: The following code demonstrates some of the HTML form elements following the principles.
Please Login to comment...