Himas Rafeek
Posted on: 2 years ago
CSS

Justify one line of text in CSS

This simply justifies a single line of text via CSS.


                                          h2 {
    height: 40px;
    /* Specifying the height and line-height prevents */  line-height: 40px;
    /* extra space from being added to the bottom.    */  text-align: justify;
    text-align-last: justify;
    /* Internet Explorer 6+ */
}
 h2:after {
    /* All other browsers */  content: ".";
    display: inline-block;
    width: 100%;
    height: 0;
    visibility: hidden;
}