1

I am Using asp.net and i have the following Data :

Users are prohibited from posting or transmitting any unlawful, threatening,libelous, defamatory, obscene, scandalous, inflammatory, abusive, hateful, pornographic, or profane material, or any material that could constitute or encourage conduct that would be considered a criminal offense, give rise to civil liability, or otherwise violate any law. We reserve the right, in our sole and absolute discretion, to terminate, suspend or restrict your access to this Site, unilaterally and without notice, in the event you violate any of the terms of this Agreement. In addition, if asked to do so, you agree that you will not attempt to access this Site. We also reserve any and all remedies at law or equity in connection with any violation of this Agreement. You agree, at your own expense, to indemnify, defend and hold the Company (and its subsidiaries, affiliates, officers, directors, agents, employees and third parties providing content) harmless from and against any claim or demand and all losses incurred related to the use of the Site.

We use a diverse range of information, text, photographs, designs, graphics, images, sound and video recordings, animation, content, advertisement and other materials and effects (collectively "Materials") for the search services on the Media. We provide the Material through the Media FOR YOUR PERSONAL AND NON-COMMERCIAL USE ONLY.

I have tried this but the result is the text are align to left. I want to justify the text. Is there any attribute for justifying the text in asp.net using css? Please help.

4

3 回答 3

1

如果您正在使用divp标记,则inline style如图所示使用它们

<div style="text-align:justify;">Users are prohibited from posting or transmitting any unlawful, threatening,libelous, defamatory, obscene, scandalous, inflammatory, abusive, hateful,                          pornographic, or profane material, or any material that could constitute or encourage  conduct that would be considered a criminal offense, give rise to civil liability, or                                                       otherwise violate any law. We reserve the right, in our sole and absolute discretion, to terminate, suspend or restrict your access to this Site, unilaterally and without notice, in the event you violate any of the terms of this Agreement. In addition, if asked to do so, you agree that you will not attempt to access this Site. We also reserve any and all remedies at law or equity in connection with any violation of this Agreement. You agree, at your own expense, to indemnify, defend and hold the Company (and its subsidiaries, affiliates, officers, directors, agents, employees and third parties providing content) harmless from and against any claim or demand and all losses incurred related to the use of the Site.
  We use a diverse range of information, text, photographs, designs, graphics, images, sound and video recordings, animation, content, advertisement and other materials and effects (collectively "Materials") for the search services on the Media. We provide the Material through the Media FOR YOUR PERSONAL AND NON-COMMERCIAL USE ONLY.</div>

或者尝试将样式表添加到您的应用程序并尝试使用所示样式

.mytext{
text-align:justify;
}

在您的网页中,您可以使用它,如图所示

<div style="mytext">your text goes here...</div>
于 2013-09-11T06:36:49.893 回答
0

<p style="text-align:justify;">...</p>在您的 HTML 中使用。最好在 CSS 中定义样式元素

HTML

<p class="justified">...</p>

CSS

.justified {
    text-align: justify;
}

如果你使用Label,你可以设置HorizontalAlign属性:

<asp:Label HorizontalAlign="Justify" runat="server">
    Some Content
</asp:Label>
于 2013-09-11T06:37:35.923 回答
0

我尝试了大多数建议但无法让它工作(gridview),所以添加了一个css类......

   .LabelFormat
    {
             padding-bottom:4px
    }

蹩脚,但它的工作。

于 2015-05-27T16:06:02.047 回答