0

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.

Sample example of the 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>

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?

nbanic
  • 1,270
  • 1
  • 8
  • 11
Learning
  • 19,469
  • 39
  • 180
  • 373

1 Answers1

2

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.

I found a solution on http://blog.vjeux.com/2011/css/css-one-line-justify.html

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!

cherry3
  • 79
  • 7
  • I agree with you i was copy pasting text to get it fixed and may be it was share out of frustration i copied the wrong HTML code, Thanks and your answer did trick for me. – Learning Jan 19 '12 at 08:31