Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,

I want to give functionality where user can upload photo for his profile picture .
But on my teamplate the image which displays is in very small size as profile image.
I am not getting how can i convert that image so proper image will be available as profile on my master page

ASP.NET
<div class="profile_img">
                                               <span style="background: url(images/1.jpg) no-repeat center"></span>
                                               <div class="user-name">
                                                   <asp:Literal ID="ltrWelcomeUser" runat="server"></asp:Literal>
                                               </div>
                                               <i class="lnr lnr-chevron-down"></i>
                                               <i class="lnr lnr-chevron-up"></i>
                                               <div class="clearfix"></div>
                                           </div>



and the css are

.profile_img span {
    width: 30px;
    height: 30px;
}


.profile_img span{
	float:left;
	display:block;
	width:40px;
	height:40px;
	border-radius:3em;
	-webkit-border-radius:3em;
	-moz-border-radius:3em;
	-o-border-radius:3em;
	  -webkit-background-size: cover;
	  -moz-background-size: cover;
	  -o-background-size: cover;
	  background-size: cover;
}
Posted
Comments
Sinisa Hajnal 8-Jan-16 6:30am    
Are you trying to really resize uploaded image? Or just to show it as 50 x 50 image regardless of how big it really is? You cannot apply width and height to span without adding display: inline-block or display: block or float to it. spans are by default inline elements and cannot be sized...

And why are you using span element to show the image when there is perfectly valid img element?
Torakami 8-Jan-16 14:09pm    
I just want to display my image completely in that mentioned size.
Obviously I will give size limit validation while uloading ... but say if person is uploading his photo .. his photo should get displayed in that width in my span

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900