# Coding Standards Documentation
## Introduction
This document outlines the common HTML class naming conventions and structure to ensure consistent, readable, and maintainable code in our web projects.
## Buttons
- `.btn`:
- **Description**: Used to style generic buttons.
- **Example**: ``
- `.btn--large`:
- **Description**: Styles large buttons.
- **Example**: ``
- `.btn--small`:
- **Description**: Styles small buttons.
- **Example**: ``
## Layout
- `.container`:
- **Description**: Wraps the main content of a web page, centering the content and limiting its width.
- **Example**: `
`
- `.col`:
- **Description**: Divides a `.row` into vertical columns. Width is often defined by additional classes or styles.
- **Example**: `
...
`
## Sections
- `.header`:
- **Description**: Styles the top section of a web page, including the navigation bar and logo.
- **Example**: `...`
- `.main`:
- **Description**: Styles the main content area of a web page.
- **Example**: `...`
- `.footer`:
- **Description**: Styles the footer of a web page.
- **Example**: ``
## Forms
- `.form`:
- **Description**: Styles the entirety of forms.
- **Example**: ``
- `.input`:
- **Description**: Can style multiple form elements. Specific classes should be used for distinct input types.
- **Example**: ``
- `.text`, `.password`, `.checkbox`, `.radio`:
- **Description**: Styles individual types of inputs.
- **Examples**:
- Text: ``
- Password: ``
- Checkbox: ``
- Radio: ``
## Tables
- `.table`:
- **Description**: Used to style tables of data.
- **Example**: `
...
`
## Images
- `.image`:
- **Description**: Styles generic images.
# Usage of Inline and Block Elements
Understanding the difference between inline and block elements is pivotal for structuring and styling web content effectively.
## Inline Elements
Inline elements do not start on a new line and take up as much width as necessary. They're like words in a sentence — they flow with the content.
Examples include:
- **Links (``):** Hyperlinks to another resource.
- **Usage**: `Visit Example`
- **Images (``):** Embeds an image.
- **Usage**: ``
- **Strong Emphasis (``):** Denotes strong importance, typically displayed as bold.
- **Usage**: `Important text.`
- **Emphasis (``):** Gives emphasized text, usually rendered as italic.
- **Usage**: `Emphasized text.`
- **Code (``):** Designates a single line of code.
- **Usage**: `let x = 10;`
- **Span (``):** Generic inline container for phrasing content. Doesn't convey any meaning on its own.
- **Usage**: `Highlighted text`
- **Abbreviations (``):** Represents an abbreviation or acronym.
- **Usage**: `HTML`
- **Inline Quotation (``):** Denotes a short inline quotation.
- **Usage**: `Cogito, ergo sum`
## Block Elements
Block elements start on a new line and typically take up the full width of their parent container.
Examples include:
- **Paragraphs (`
`):** Denotes a block of text.
- **Usage**: `
This is a paragraph.
`
- **Headings (`
` to `
`):** Mark section headings, with `
` being the most prominent and `
` the least.
- **Usage**:
- `
Main Title
`
- `
Subheading
`
- ...
- `
Smallest Subheading
`
- **Lists:**
- **Unordered (`
`):** List without a specific order.
- **Usage**:
```html
`):** Displays text with whitespace preserved, often used with ``.
- **Usage**:
```html
function hello() {
console.log("Hello, world!");
}
```
- **Figures (`` and ``):** Used to mark up a photo or graphic with an optional caption.
- **Usage**:
```html
Caption for the image.
```
## Conclusion
Choosing the correct element—whether inline or block—enhances the semantic value of the content, improves accessibility, and makes styling more straightforward.
- **Example**: ``
- `.img-responsive`:
- **Description**: Ensures images are responsive and adjust to their container's width.
- **Example**: ``
## Conclusion
By adhering to these naming conventions and standards, we ensure that our code remains consistent across projects, making it easier for developers to collaborate, maintain, and extend the codebase.