【问题标题】:reduce the height of only one row out of multiple rows减少多行中仅一行的高度
【发布时间】:2018-02-11 13:38:04
【问题描述】:

我的网页中有多个图表。我只想降低第一个图表的第二行的高度,可以吗?或者我可以降低第一个图表中第二行彩色条的高度吗?

请找到演示:https://plnkr.co/edit/QXjNsM8z0jbU2gB3Hq31?p=preview

生成的代码: 我尝试使用下面的代码,但它适用于所有行,我只想减少第一张图表第二行的高度。

示例代码:

#t1 svg rect {
    height:4px;
}

【问题讨论】:

标签: html css svg rect


【解决方案1】:

您可以使用 nth-of-type 来执行此操作:

#t1 svg text:nth-of-type(2) {
height:4px
}

编辑

rect:nth-of-type(2) {height:4px}

W3 Schools CSS :nth-of-type()

【讨论】:

  • 我想减少矩形的高度或只完成chart1的第二行。
  • 尝试使用 rect:nth-of-type(2) {height:4px}
  • 如果这会导致问题,那么您可以尝试类似 #chart1 rect:nth-of-type(2) {height:4px}
猜你喜欢
  • 1970-01-01
  • 2020-01-20
  • 1970-01-01
  • 1970-01-01
  • 2013-07-02
  • 2012-02-24
  • 2021-03-14
  • 2015-04-02
  • 2019-12-17
相关资源
最近更新 更多