how do you set css to add an asp img?
I need to control the size of the image within the div aswell and its alignment? Preferably to the right and make it 15% of the size inside the div?
Any of this possible?
div#test {
width:90%;
z-index:1;
padding:27.5px;
border-top: thin solid #736F6E;
border-bottom: thin solid #736F6E;
color:#ffffff;
margin:0 auto;
white-space: pre;
white-space: pre-wrap;
white-space: pre-line;
word-wrap: break-word;
}
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
Chances are no.
If you mean an image server control (either <asp:Image> or `) CSS is a client-side technology while any Asp.NET server controls are server-side. (keyword: in server controls is server 😉 )
If you mean an HTML image (<img> with no runat="server") then no again. You’d use JavaScript to do this: CSS cannot add elements (things with tags like <img>) to the document. It can add text context using the content property but not elements like <img>.
Lastly, if you mean give “the div” a background image, yes, CSS can do this, using the background-image property… but I don’t think you can resize background images. Maybe with CSS3… I’m not sure.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0