Reputation: 63
This is for a nodecg bundle, so excuse all the seemingly useless script tags
<body>
<div class="main-list">
<script>
var type="donation";
var user="TestUser";
var amount="$1.00";
document.write("<div class='list-element' class='" + type + "' >");
document.write(user);
document.write("<span class='pull-right'>" + amount + "</span>" + "</div>");
</script>
</div>
</body>
.main-list{
margin: auto;
width: 486px;
color: #ecf0f1;
font-size: 23px;
background-color:#494949;
}
.list-element {
list-style-type: none;
padding-top: 9px;
padding-left: 9px;
height: 39px;
border-top: 1px solid;
rgba(125, 125, 125, .5);
}
.pull-right: {
float:right;
margin-right:9px;
}
I know it is sloppy code and I could consolidate it into one document.write, but my issue is that I cannot get the pull-right class to move the amount to the right.
https://jsfiddle.net/b9pzofLx/1/
Upvotes: 3
Views: 88