在asp.net中使用CSS我不能证明单行文本 [英] I can't justify single line text using CSS in asp.net

查看:154
本文介绍了在asp.net中使用CSS我不能证明单行文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有相关的文章中的列标签字段的问题是,我不能对齐的标题条这不应该是长度超过30个字符,当我将其显示为一种股票的。客户的要求是使文章,标题为对齐。我试过,但我不能让它证明,因为它是一个单行标题。

I have to article related columns in label field problem is that I cant Justify the Article Heading which should not be more than 30 characters in length when I display it as a sort of ticker. Client requirement is to make the article heading "Justify". I tried but I can't make it justify as it is a single line heading.

在code样本例如

.Desc4x4
{
   text-align:justify; 
   font-size:8px; 
   font-family:Tahoma, Geneva, sans-serif; 
   font-weight:bold; 
   padding-left:0px; 
   padding-top:0px; 
   color:White; 
   width:194px;
   height:34px;
   vertical-align:top;
}


<div >
    <asp:Label ID="lblTopFourDesc" runat="server"  Text='<%# Eval("ArticleDesc")%>'> </asp:Label>
 </div>

我的问题是,我们才能证明单行项目,我想在MS Word一样的我是不是能够证明单行标题,但同样的,当超过两行,它会自动合理的文本。

My question is can we justify single line items, I tried same in MS Word I was not able to justify single line heading but when same exceeded to two line it automatically justified the text.

我应该怎么做来证明文本或它是不可能的?

What should I do to Justify the text or it is not possible?

推荐答案

您code看起来不完整的!你不是在申请的CSS到你的股利。
我是pretty确保创建此code,当你尝试过。但是,在您的文章看起来不完整的。

Your code looks incomplete! You are not applying the css to your div. I'm pretty sure you tried it when creating this code. But in your post it looks incomplete.

我发现 HTTP的解决方案://blog.vjeux .COM / 2011 / CSS / CSS-1线justify.html

试试如下因素CSS链接到您的div的文字。这个CSS放在你的单行后空内容。 CSS这样,认为你多行文本。

Try link the folowing css to the text in your div. This css places empty content after your single line. That way css thinks you have multi-line text.

.Desc4x4:after {
  content: "";
  display: inline-block;
  width: 100%;
}

让我知道这对你的作品!

Let me know if this works for you!

这篇关于在asp.net中使用CSS我不能证明单行文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆