我想使用CSS在标签文本上将星号标记显示到正确的位置但是在vaadin 8.6.2中无法成功
.v-label-wrap {
content: " *";
color: red;
position: absolute;
white-space: normal !important;
word-break: normal !important;
word-wrap: normal !important;
}
Label lblAttr = new Label("Name");
lblAttr.addStyleName("wrap");
需要显示带红色的星号*。请指教如何解决这个问题
像这样使用::after
:
.v-label-wrap::after {
content: "*";
color: red;
}
有关更多信息:MDN ::after/:after
它通常用于向具有content属性的元素添加化妆品内容。它默认为内联。