简体   繁体   中英

How to add space for Label text dynamically in asp.net

Hi all i am trying to add an image dynamically to a Label as follows which works fine, but i would like to add a space after the image and i would like to write mt required text i tried as follows but i am unable to find space between image and text

Label1.Text = "<img src='Images/warning (1).png' />Select atleast one?";

I need space(tab space) after the image

My present one is as follows

在此处输入图片说明

Add &nbsp; (space).

Label1.Text = "<img src='Images/warning (1).png' />&nbsp;&nbsp;&nbsp;&nbsp;Select atleast one?";

Well, you could try

Label1.Text = "<img src='Images/warning (1).png' />nbsp;nbsp;nbsp;nbsp;Select atleast one?";

or you coud use two different controls, one for the image and one for the text, and use a table to make them "look pretty"

我想你也可以像

img{ margin-right:5px; }
Label1.Text = "<img src='Images/warning (1).png' />&nbsp;&nbsp;&nbsp;&nbsp;Select atleast one?";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM