我记得之前可以给一个块,或者块里的一部分内容加上附注,这个附注会在块的右上角空白的地方一直显示,不会覆盖已有的内容。忘了怎么操作了,哪位知道?
相关帖子
-
JeffreyChen •付费者 支持者 捐赠者
用这个 CSS 片段,不过如果备注有多行文本的话样式会有问题,并且备注如果有点长的话就显示不完全了:
.protyle-attr--memo.b3-tooltips { max-width: 25vw; display: flex; align-items: center; overflow: hidden; svg { overflow: initial; margin-right: 2px; } &::before { display: none; } &::after { opacity: 1; display: contents; position: inherit; content: attr(aria-label); white-space: pre; z-index: inherit; padding: inherit; font-size: inherit; font-weight: inherit; -webkit-font-smoothing: inherit; color: inherit; word-wrap: inherit; background-color: inherit; border-radius: inherit; line-height: inherit; transform: inherit; max-width: inherit; overflow: inherit; text-overflow: inherit; box-sizing: inherit; box-shadow: inherit; font-family: inherit; } }
-
-
用这个 CSS 片段,不过如果备注有多行文本的话样式会有问题,并且备注如果有点长的话就显示不完全了:
.protyle-attr--memo.b3-tooltips { max-width: 25vw; display: flex; align-items: center; overflow: hidden; svg { overflow: initial; margin-right: 2px; } &::before { display: none; } &::after { opacity: 1; display: contents; position: inherit; content: attr(aria-label); white-space: pre; z-index: inherit; padding: inherit; font-size: inherit; font-weight: inherit; -webkit-font-smoothing: inherit; color: inherit; word-wrap: inherit; background-color: inherit; border-radius: inherit; line-height: inherit; transform: inherit; max-width: inherit; overflow: inherit; text-overflow: inherit; box-sizing: inherit; box-shadow: inherit; font-family: inherit; } }
1 回复 -
把这个优化了一下:
.protyle-attr--memo.b3-tooltips { max-width: 25vw; align-items: center; overflow: flow; height: 16px; opacity: 0.75; text-overflow: ellipsis !important; white-space: nowrap !important; max-width: 25em; cursor: help; svg { overflow: initial; margin-right: 2px !important; } &:hover { color: white !important; background: #000000d6; z-index: 111; width: max-content; display: table; border-radius: 4px; border: 1px solid black; } &::before { display: none; } &::after { opacity: 1; display: contents; position: inherit; content: attr(aria-label); white-space: pre; z-index: inherit; padding: inherit; font-size: inherit; font-weight: inherit; -webkit-font-smoothing: inherit; color: inherit; word-wrap: inherit; background-color: inherit; border-radius: inherit; line-height: inherit; transform: inherit; max-width: inherit; overflow: inherit; text-overflow: inherit; box-sizing: inherit; box-shadow: inherit; font-family: inherit; } }