Setting the background color with
.cesium-infoBox {
background: rgba(255, 221, 0, 0.95);
}
works fine. But my problem is, that I need different background color depending on the infobox content. So I would like to set the background color together with the html content of the infobox.
Thanks for your help!
Ruediger
.cesium-infoBox-description, body, html { color: #000000; background-color: #FFF; }.cesium-infoBox-description * { max-width:100%; word-wrap: break-word; word-break: break-word; }.cesium-infoBox-defaultTable-lighter tr, .cesium-infoBox-defaultTable-lighter td { max-width:100%; } var dataSource = Cesium.GeoJsonDataSource.load('../data/quartier2.json').then(function(data) {
viewer.dataSources.add(data);
var entities = data.entities.values;
for (var i = 0; i < entities.length; i++)
var entity = entities[i]; if (entity.properties.hasOwnProperty("description")) { entity.description = '<div style="height: 360px;">' + entity.properties.description + '</div>'; }
}
}