I ran into some bizzare CSS behavior when I was refactoring my style tags into a separate CSS file. Here is my HTML; the "parentOfViewCommentsLink" is the specific class that's acting strange.
<div class="parentOfViewCommentsLink" style="height=20%">
<span ng-show="image.description">{{ image.description }} </span>
<div ng-hide="image.description" class="noDescription">No Description Found</div>
<!-- <div data-ng-click="vm.navToComments()">Comments</div> -->
<div class="viewCommentsLink" ng-click="vm.viewComments()">View {{image.comments.length}} Comments</div>
<div class="{{vm.flagClass}}" ng-click="vm.flagged()"> </div>
<!--<div class="ion-archive" ng-click="vm.downloadMoment(image)"> </div>-->
</div>
and my CSS:
/* Comments */
.viewCommentsLink {
position: absolute;
bottom: 10px;
left: 10px;
}
.parentViewCommentsLink {
position: relative;
}
This HTML/CSS produced this bizzare result:
Scratching my head at this strange behavior because it just worked - All I did was extract my style tags into a CSS file. After playing around with it I was able to fix it!
How you might ask? Well I threw a '2' in front of the class name:
<div class="2parentViewCommentsLink" style="height=20%">
<span ng-show="image.description">{{ image.description }} </span>
<div ng-hide="image.description" class="noDescription">No Description Found</div>
<!-- <div data-ng-click="vm.navToComments()">Comments</div> -->
<div class="viewCommentsLink" ng-click="vm.viewComments()">View {{image.comments.length}} Comments</div>
<div class="{{vm.flagClass}}" ng-click="vm.flagged()"> </div>
<!--<div class="ion-archive" ng-click="vm.downloadMoment(image)"> </div>-->
</div>
CSS:
/* Comments */
.viewCommentsLink {
position: absolute;
bottom: 10px;
left: 10px;
}
.2parentViewCommentsLink {
position: relative;
}
I have no idea why this worked or why it would even make a difference. I do not have another class name parentOfViewCommentsLink anywhere and at this point I'm just curious as to why this even worked. Anyone have any ideas?
EDIT: "I've also tried "parentViewCommentsLink", "viewCommentsLinkParent" niether of which worked