I have a div with class widget and I applied width and length styling to my widget class, but for some reason, the width is still 100% of the screen instead of 200px like I defined below. Can someone help?
Here's a fiddle:
https://jsfiddle.net/ps17t1a5/
html, body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
display: table
}
.widget {
display: table-cell;
text-align: center;
vertical-align: middle;
margin: 0;
width: 500px;
height: 200px;
padding: 7px;
}
<body ng-controller="main_controller">
<div class="widget">
<h1>{[city]}, {[state]}</h1>
<div>
<h1 style="float: left">{[current_temp | degree]}</h1> <h1 style="float: right">afasf</h1>
</div>
<p>{[today_day]}</p>
<p>{[today_high | degree]} / {[today_low | degree]}</p>
</div>
</body>
.widgetis a common class, and may be used by a plugin, which overwrites the rule.display:tablefrom thehtml, bodyselector.display: tablefrom thebody, the width attribute is honoured. I am off to try to find out why that is the case (see updated fiddle jsfiddle.net/ps17t1a5/2)