7.13. Bootstrap5 badge

发布时间 :2024-01-11 23:00:02 UTC      

Image0

Badges (Badges) are mainly used to highlight new or unread items. To use a badge, just set the .badge class plus a color class with a specified meaning, such as .bg-secondary ) add to <span> on the element. Badges can vary according to the size of the parent element:

7.13.1. Example

<h1>test title <span class="badge bg-secondary">New</span></h1>
<h2>test title <span class="badge bg-secondary">New</span></h2>
<h3>test title <span class="badge bg-secondary">New</span></h3>
<h4>test title <span class="badge bg-secondary">New</span></h4>
<h5>test title <span class="badge bg-secondary">New</span></h5>
<h6>test title <span class="badge bg-secondary">New</span></h6>

Badges of various color types

Badges of all color types are listed below:

7.13.2. Example

<span class="badge bg-primary">main</span>
<span class="badge bg-secondary">secondary</span>
<span class="badge bg-success">success</span>
<span class="badge bg-danger">dangerous</span>
<span class="badge bg-warning">warn</span>
<span class="badge bg-info">information</span>
<span class="badge bg-light">light colour</span>
<span class="badge bg-dark">deep colour</span>

Pill shape badge

Use .rounded-pill class to set the pill shape badge:

7.13.3. Example

<span class="badge rounded-pill bg-default">default</span>
<span class="badge rounded-pill bg-primary">main</span>
<span class="badge rounded-pill bg-success">success</span>
<span class="badge rounded-pill bg-info">information</span>
<span class="badge rounded-pill bg-warning">warn</span>
<span class="badge rounded-pill bg-danger">dangerous</span>

Insert the badge into the element

The following example embeds a badge into a button:

7.13.4. Example

<button type="button" class="btn btn-primary">
  Messages <span class="badge bg-light">4</span>
</button>

Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.