# Glass Weather Card

> A frosted glass weather widget with a CSS-drawn sun and cloud, the current temperature and a short forecast.

- Category: [CSS Cards](https://copy-css.com/category/cards)
- Tags: weather, widget, glassmorphism, forecast, frosted, dashboard
- Live preview: https://copy-css.com/snippets/glass-weather-card
- License: Free for personal and commercial use. No signup, no attribution required.

## HTML

```html
<article class="weather-glass">
  <div class="weather-glass-now">
    <div>
      <h3>Lisbon</h3>
      <p>Partly cloudy</p>
    </div>
    <span class="weather-glass-icon" aria-hidden="true"></span>
  </div>
  <p class="weather-glass-temp">21°</p>
  <ul>
    <li>Mon <b>22°</b></li>
    <li>Tue <b>19°</b></li>
    <li>Wed <b>24°</b></li>
  </ul>
</article>
```

## CSS

```css
.weather-glass {
  width: 220px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.08));
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: #fff;
  font-family: system-ui, sans-serif;
}

.weather-glass-now {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.weather-glass h3 {
  margin: 0;
  font-size: 16px;
}

.weather-glass-now p {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.85;
}

.weather-glass-icon {
  position: relative;
  width: 34px;
  height: 34px;
  margin: 4px 14px 0 0;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fef08a, #f59e0b);
  box-shadow: 0 0 20px rgba(253, 224, 71, 0.7);
}

.weather-glass-icon::after {
  content: "";
  position: absolute;
  top: 18px;
  left: 12px;
  width: 34px;
  height: 14px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 8px -7px 0 2px #fff;
}

.weather-glass-temp {
  margin: 2px 0 10px;
  font-size: 48px;
  font-weight: 300;
  line-height: 1;
}

.weather-glass ul {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.weather-glass li {
  display: grid;
  gap: 2px;
  padding: 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 11px;
  text-align: center;
}

.weather-glass b {
  font-size: 14px;
}
```

## Notes

- This CSS Glass Weather Card is 80 lines of pure CSS (1.4 KB) with no JavaScript and no dependencies. It uses linear gradients, radial gradients, box shadows and backdrop filters.
- backdrop filters: Includes the -webkit- prefix for older Safari.
- In JSX use `className` instead of `class`. In Tailwind projects put the CSS in the global stylesheet.
