简体   繁体   English

如何在ASP.NET中动态添加标签文本的空间

[英]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 大家好,我尝试按如下所示向Label动态添加图像,这很好,但是我想在图像后添加一个space ,我想按以下方式编写mt必需的文本,但是我找不到空间在图像和文字之间

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; 添加&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?";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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