I have a div with text-align:center
.
Inside the div I have a span
.
In the fiddle you can see the output 1,2 3, etc.
It is float:left
, so I get the output it in one line.
But inside the div it is not obeying the style, text-align:center
.
If I remove float left, the outputs will be in different lines but the text will be aligned center.
I need all my output in one line and it should aligned to the center of the div
.
function TodoCtrl($scope) {
$scope.col = ['1', '2', '5', '8'];
$scope.cols = ['1', '2', '5', '8'];
}
.ll {
text-align: center;
}
p {
float: left;
}
<div ng-repeat="c in size">
<span ng-repeat="m in p.size" ng-if="m == c.id">
<a href="" ng-click="select_size(c.id)"
ng-class="{gvborder : allsels == c.id}">
<p style="text-align:center; float:left"> {{c.name}} </p>
</a>
</span>
</div>
My fiddle is here