html - 我无法对齐段落的行。意味着从第一行开始,我也希望从那里开始第二行
问题描述
很抱歉,我不知道您是否从标题中理解了我的问题,但是您可能从我分享的图像中理解了。我想要一条线与红线对齐。表示从第一个单词开始的地方,我希望第二行也从那里开始。我也分享了我的编码。请查看它并让我知道缺少什么。
这是我正在使用的代码
<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>
解决方案
您可以更改边距/填充并将图标移到额外的空间中。
.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>
推荐阅读
- mongodb - 如何从使用 kops 创建的 Kubernetes 集群内运行的应用程序访问 ec2 实例上的外部 MongoDB 服务器?
- mysql - AWS RDS Mysql 集群不会在写入查询时自动扩展
- r - glmmTMB 与不规则时间的自相关
- python - 描述中的 Matplotlib tex-macro
- php - CURL 错误:140770FC:SSL 例程:SSL23_GET_SERVER_HELLO:未知协议
- c - 在 C 中以编程方式读取文件描述符表
- javascript - 如何在弹出窗口中集中输入(模态)
- java - 如何减少 Alpakka 的 Kafka 日志文件大小
- javascript - after() 在注入的 HTML 周围加上引号
- sql-server-data-tools - 分析解析器的 XML:服务器无法识别限制版本