Wednesday, October 30, 2013

Scaling div size with background image whilst keeping aspect ratio

The easiest way is to use below style for the div



<div class="divImage" style='<%# "background: url(\"" + DataBinder.Eval(Container.DataItem, "divImage") + "\") no-repeat center center; background-size: cover;" %>'></div>


A more detailed approach is listed in this post

No comments:

Regex Email validation in c# dot net core

 Use this regex /^_?[a-zA-Z0-9]([a-zA-Z0-9]*[._+-])*[a-zA-Z0-9_]+@(?!-)[A-Za-z0-9-]{1,63}(?<!-)(\.(?!-)[A-Za-z0-9-]{1,63}(?<!-))*\.[A-...