i want to apply the following class to my image element :
.laptopimage {
width: 115px;
height: 93px;
display: block;
margin-left: auto;
margin-right: auto;
border: 10px solid black;
}
my code in aspx.cs file :
Image image=new Image();
image.ImageUrl="~/Images/"+p.ImagePath;
image.CssClass = "laptopimage";
the resulted html code :
<img class="laptopimage" src="../Images/Laptop1.jpg"></img>
I can't understand why it doesn't apply css. The image is still displayed 1700x1700; Can someone explain why this is happening ?
laptopimage