Materialize Css Tooltip

2020-07-10 07:31发布

I was wondering is it possible to give each tooltip a different background color in materialize.css framework?

When the tooltip is activated I don't see any additional markup generated in the inspector, therefore can not target with CSS.

7条回答
成全新的幸福
2楼-- · 2020-07-10 08:14

You can customise a tooltip with the following css (Materialize 1.0.0)

.material-tooltip {
  padding: 10px 8px;
  font-size: 1rem;
  z-index: 2000;
  background-color: transparent;
  border-radius: 2px;
  color: #fff;
  min-height: 36px;
  line-height: 120%;
  opacity: 0;
  position: absolute;
  text-align: center;
  max-width: calc(100% - 4px);
  overflow: hidden;
  left: 0;
  top: 0;
  pointer-events: none;
  visibility: hidden;
  background-color: #323232;
  font-family: "Roboto Mono";
  font-size: 0.8em;
  font-weight: 700;
}
查看更多
登录 后发表回答