使用css执行分词后添加缩进

问题描述 投票:0回答:1

我想在分词后移到新行的文本中添加缩进。目前,它甚至不考虑给父对象赋予的填充左,并且在分词后显示在最左侧。

enter image description here在上图中,您可以看到权限行正在执行分词,0 ...正在左侧。我希望它显示在P的第一个字母下面或之后。

  position: relative;
  left: 76%;
  top: -755px;
  width: 22%;
  height: 508px;
  color:rgb(3, 3, 3);
  background-color: #bdddf0;
  z-index: 10;
  border-style: groove;
  border-radius: 10px;
  padding-top: 15px;
  padding-right: 3px;
  line-height: 1.5;
  margin: 15px;
  overflow: auto;
  max-height: 630px;
  overflow-wrap: break-word;
  word-wrap: break-word;
  font-size: 15px;
  h2 {
    margin-bottom: 2%;
  }

.SummaryPanel是父元素的className。我该如何控制自动换行和缩进?有可能控制它吗?

css reactjs
1个回答
0
投票

您必须在下面的summarypanel类中添加text-indent属性

    padding-left: 2em;
    text-indent: -2em;

示例:https://jsfiddle.net/9phwnxby/1/

希望能帮助到你

© www.soinside.com 2019 - 2024. All rights reserved.