相对位置和左右属性一起不起作用,只剩下工作了

时间:2016-09-13 20:42:04

标签: jquery html css angularjs

我正在使用这个树网格指令github.com,而下面的css直接来自这个库。

.tree-grid .level-2 .indented {
    position : relative;
    left     : 20px;
}

<td><a ng-click="user_clicks_branch(row.branch)"><i ng-class="row.tree_icon" ng-click="row.branch.expanded = !row.branch.expanded" class="indented tree-icon"></i></a><span class="indented tree-label tree-grid-row level-2>
             Citi Corporate and Investment Banking</span>
            </td>

我遇到的问题是td内的跨度溢出并显示在下一列中,为此目的我需要添加右:20px,但它不起作用。

这个问题有没有解决办法? plnkr.co

3 个答案:

答案 0 :(得分:0)

将现有的 CSS规则更改为时,您应该将REM ***** BASIC ***** https://www.prahladyeri.com/blog/2016/02/ten-libreoffice-macro-recipes.html#searchandrepl Sub replace_letters Dim badletters() As String Dim goodletters() As String Dim n As Long Dim document As Object Dim pages as Object Dim sheet as Object Dim replace As Object badletters() = Array("À", "È", "Ë", "Á", "Ð", "Ø", "Û", "Þ", "à", "è", "ë", "á", "ð", "ø", "û", "þ") goodletters() = Array("Ą", "Č", "Ė", "Į", "Š", "Ų", "Ū", "Ž", "ą", "č", "ė", "į", "š", "ų", "ū", "ž") document = ThisComponent rem ?? need every page - see sheet = doc.CurrentSelection.Spreadsheet pages = document.getDrawPages() page = pages.getByIndex(0) replace = page.createReplaceDescriptor rem document.createReplaceDescriptor in case of Writer rem replace.SearchRegularExpression = True For n = lbound(badletters()) To ubound(badletters()) replace.SearchString = badletters(n) replace.ReplaceString = goodletters(n) page.replaceAll(replace) Next n MsgBox("Done") End Sub 值一起传递:

left: auto;

答案 1 :(得分:0)

听起来您正在尝试为span元素添加边距。为此,请使用 margin-right margin-left 属性。

同时使用 left right 是没有意义的。您只能相对于父框元素的一个垂直边和一个水平边定位。

答案 2 :(得分:0)

只需添加padding-right: 20px;即可提供您所要求的内容。

我从CSS中选择了目标范围,如

<!DOCTYPE html>
<html ng-app="abas-web">
  ...
  <body>
  ...
  <style>
    span.indented.tree-label {
      left: auto !important;
      padding-left: 60px;
      padding-right: 20px;
    }
  </style>
  </body>

</html>

注意:我使用!important覆盖您之前放置的样式设置。这仅用于演示目的。你应该删除left样式,而不是像那样覆盖它。

Demo