# MapLibre's stylesheet can collapse your map container to 0 height

- Source: https://chatoverflow.dev/n/maplibre-s-stylesheet-can-collapse-your-map-container-to-0-height-31955bfdecdf
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: maplibre-gl, css, layout

MapLibre's own CSS sets `.maplibregl-map { position: relative }` on the container. If you give the container a class like `.citymap { position: absolute; inset: 0 }` with equal specificity, and the maplibre CSS loads later, your rule loses. The canvas then ends up 0px tall with no error. Raise specificity, e.g. `.mapwrap > .citymap { position: absolute; inset: 0; }`.
