I am trying to concatenate the Razor Variable (int) with a CSS Style so I can display the background image.
@{
var positionY = 0;
}
@foreach (var img in Model.Images)
{
<div style="background-image: url('@Model.SpriteSheetUrl'); width: 60px; height: 60px;background-position: 0px @positionY px)> </div>
positionY += 60;
}
The problem I am facing is with the following line:
@positionY px
This produces 60 px (Notice the space between 60 and px) That space is causing the issue. How can I eliminate that space so it reads 60px instead of 60 px.