初学者:对齐文本

时间:2016-08-02 23:34:17

标签: css text justify

我是初学者,正在为班级作业工作,在尝试证明我的某个网站中的文字时,我遇到了一些困难。

如果有人能帮助我,我真的很感激!

HTML:

<div class="about__entry sm-two-thirds">
    <p>We believe in the power of authentic and genuine music, not manufactured artists. We believe in the freedom of music, expression, and creativity. We aim to give artists tools that will empower them to make the music they love and give them the ability to take their careers into their own hands.</p>
</div><!-- end .about__entry -->

CSS

.About__entry {
    text-align: justify;
    text-justify: inter-word;
    text-align-last:center;
}

2 个答案:

答案 0 :(得分:4)

CSS区分大小写,例如对于班级名称。

About__entry != about__entry

答案 1 :(得分:0)

以下是一个固定示例:https://jsfiddle.net/v6L94v27/

您只需要匹配类名的大小写(类名有大写字母A)

<div class="About__entry sm-two-thirds">
         <p>We believe in the power of authentic and genuine music, not manufactured artists. We believe in the freedom of music, expression, and creativity. We aim to give artists tools that will empower them to make the music they love and give them the ability to take their careers into their own hands.</p>
    </div><!-- end .about__entry -->