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:

c# httpclient The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch

 If we get this error while trying to get http reponse using HttpClient object, it could mean that certificate validation fails for the remo...