首页 > 解决方案 > 我无法对齐段落的行。意味着从第一行开始,我也希望从那里开始第二行

问题描述

很抱歉,我不知道您是否从标题中理解了我的问题,但是您可能从我分享的图像中理解了。我想要一条线与红线对齐。表示从第一个单词开始的地方,我希望第二行也从那里开始。我也分享了我的编码。请查看它并让我知道缺少什么。 我想要一条线与红线对齐。 表示从第一个单词开始的地方,我希望第二行也从那里开始。

这是我正在使用的代码

<h3>
  Important Notice About Blogger Widget
</h3>

----

<span class="sh-msg">
  <b> Note:</b> You can not change the number of votes. The maximum is 100 whereas the number of the minimum votes is 20. The Star Rating widget script will show the rating that you select from 1 to 5 and your readers can not vote.
</span>

<style>
.sh-msg {
    font-style: normal;
    padding: 20px 20px;
    display: block!important;
    clear: both;
    line-height: 1.5em;
    -webkit-border-radius: 3px;
    border-radius: 3px;
    border: 2px solid rgba(0,0,0,0.05);
    color: #FFF;
    font-weight: 400;
    font-size: 13px;
    text-align: justify;
    box-shadow: 0px 2px 8px 3px #ccc;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.sh-msg:before {
    content: "\f05a";
    display: inline-block;
    padding-left: 0;
    font-family: 'FontAwesome';
    font-size: 22px;
    vertical-align: middle;
    font-weight: 400;
}
.sh-msg {
    background-color: #8870FF;
}
</style>

标签: htmlcss

解决方案


您可以更改边距/填充并将图标移到额外的空间中。

.sh-msg {
    font-style: normal;
    /* altered the padding */
    padding: 20px 20px 20px 40px;
    display: block!important;
    clear: both;
    line-height: 1.5em;
    -webkit-border-radius: 3px;
    border-radius: 3px;
    border: 2px solid rgba(0,0,0,0.05);
    color: #FFF;
    font-weight: 400;
    font-size: 13px;
    text-align: justify;
    box-shadow: 0px 2px 8px 3px #ccc;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.sh-msg:before {
    content: "\f05a";
    /* altered position/display */
    position: absolute;
    /* added margin */
    margin-left: -25px;
    display: block;
    padding-left: 0;
    font-family: 'FontAwesome';
    font-size: 22px;
    vertical-align: middle;
    font-weight: 400;
}
.sh-msg {
    background-color: #8870FF;
}
<span class="sh-msg">
  <b> Note:</b> You can not change the number of votes. The maximum is 100 whereas the number of the minimum votes is 20. The Star Rating widget script will show the rating that you select from 1 to 5 and your readers can not vote.
</span>


推荐阅读