Reputation: 20031
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%;
}
Upvotes: 1
Views: 1738
Reputation: 20031
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%;
}
Upvotes: 0
Reputation: 32202
Hi you define this css stylesheet as like this
Css p, h1 {text-align: justify; text-align-last: justify;}
p:after, h1:after
{content: ".";
display: inline-block;
width: 100%;
height: 0;
visibility: hidden;}
h1
{height: 1.1em;
line-height: 1.1;
background:green;}
HTML
<h1>This is heading </h1>
<p>hello demo texthello demo texthello demo texthello demo texthello demo texthello demo texthello demo texthello demo texthello demo texthello demo texthello demo texthello demo texthello demo texthello demo text</p>
now more information about this http://kristinlbradley.wordpress.com/2011/09/15/cross-browser-css-justify-last-line-paragraph-text/
Upvotes: 3