我想使用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");
Run Code Online (Sandbox Code Playgroud)
需要显示带有红色的星号*。请咨询如何解决这个问题
::after像这样使用:
.v-label-wrap::after {
content: "*";
color: red;
}
Run Code Online (Sandbox Code Playgroud)
有关after的更多信息:MDN :: after /:after
它通常用于将化妆品内容添加到具有content属性的元素。默认情况下是内联的。