Constant

In CSS, there's no direct concept of constants as you might find in programming languages like JavaScript, Python, or C++. However, CSS Custom Properties (often referred to as CSS variables) provide a way to store values that can be reused throughout your stylesheet. While not "constants" in the strict programming sense, because their values can be changed under certain conditions, they serve a similar purpose for reusing values.

To declare a CSS Custom Property, you would define it within a selector, most commonly the :root pseudo-class for global scope. Here's an example:

:root {
  --main-bg-color: #3498db;
  --padding: 20px;
}

In this example, --main-bg-color and --padding are custom properties that hold specific values. You can use these properties elsewhere in your CSS by referencing them with the var() function:

body {
  background-color: var(--main-bg-color);
  padding: var(--padding);
}

This approach allows you to change the values in one place (:root in this case), and those changes will apply wherever the custom properties are used, mimicking the behavior of constants to some extent.

Remember, while custom properties can be overridden by more specific selectors or within media queries (which makes them behave differently from true constants), they are a powerful tool for managing and reusing values across your stylesheets.