Hi all,
while developing my own widgets I struggled with the setting of background color for the entire widget. The only one way I found so far was by using ng-style. But then another problem popped up. Look at my code first and then at the result:
<div ng-init="ServerPath='http://Raspi1:8080/static';"></div>
<a class="dashboard-link" href="#/view/DaHome">
<div ng-style="{'background-color':'rgba(120,120,120,.5)'}"
style="margin:0 auto; padding-top:0px;padding-bottom:0px;padding-left:5px;padding-right:0px; border: 2px solid yellow;">
<div class="container-fluid">
<div class="row box-cell">
<div class="col-sm-6 text-room-name">
BAD
</div>
<div class="col-sm-3 text-value1">
{{'%.01f' | sprintf:itemValue('KNX_BadDG_Temperatur')}}
<small>°C</small>
</div>
<div class="col-sm-3">
<div ng-if="itemValue('Fenster_DG_Bad')== '1'">
<img class="box-image" src="{{ServerPath}}/myicons/window-close_1_g50.svg" />
</div>
<div ng-if="itemValue('Fenster_DG_Bad')== '0'">
<img class="box-image" src="{{ServerPath}}/myicons/window-open_1_or.svg" />
</div>
</div>
</div>
</div>
</div>
</a>
CSS-file:
.container-fluid {
margin: 0;
padding: 0;
}
The result:
The problem:
Now, as you can see, the challenge here is the margin within the widget of round about 5px (outside of the yellow border). I don’t mean the space between the widgets which can be surly adjusted, I mean within the widget. Even if you look at the widgets on the lefthand side (with the big icons) there is a margin as well.
In the above code (row 4) pedding is well working, but margin:0 has no effect.
So, how to get rid of the margin, meaning set it to zero?