Search code examples
asp.netcsstext-justify

Justify single line of text not working


I need to Justify single line text and I had this issue in past and resolved it with the help of solution on Stack Overflow website

I can't justify single line text using CSS in asp.net

Now i have to do a similar thing which is not work i have put the code on Fiddle i tried even the above solution this is not working also.

May be i am doing some mistake which is not noticible to me. I am a developer by profession but have to do do design job as well on current projects

Fiddler Link http://jsfiddle.net/pp9hb/2/

This is for an ASP.Net website developer using web form & c#.

SOLUTION: Below CSS is working for me. It is now Justifying text in all browsers

.Top10ArticleHeading
{
   text-align:Justify; 
   font-size:11px; 
    font-family:Tahoma, Geneva, sans-serif;  
    height:16px;
    color:black;
    padding-top:2px;
    text-decoration:none;
    width:160px;
}
.Top10ArticleHeading:after 
{
  content: "";
  display: inline-block;
  width: 100%;
}

Solution

  • SOLUTION: Below CSS is working for me. It is now Justifying text in all browsers

    .Top10ArticleHeading
    {
       text-align:Justify; 
       font-size:11px; 
        font-family:Tahoma, Geneva, sans-serif;  
        height:16px;
        color:black;
        padding-top:2px;
        text-decoration:none;
        width:160px;
    }
    .Top10ArticleHeading:after 
    {
      content: "";
      display: inline-block;
      width: 100%;
    }