我尝试在TWebLabel上这样做,给它一个5px的实心边框并给它着色。我尝试使用本文中提到的.setProperty(How to make TWebPanel have rounded corners?)我尝试在TWebLabel(lblHome)上这样做。
lblHome.ElementHandle.style.setProperty('border-top', '5px solid #da3b26');
字符串
但什么都没发生?
我尝试在TWebLabel上这样做,给它一个5px的实心边框并给它着色。我尝试使用本文中提到的.setProperty(How to make TWebPanel have rounded corners?)我尝试在TWebLabel(lblHome)上这样做。
lblHome.ElementHandle.style.setProperty('border-top', '5px solid #da3b26');
字符串
但什么都没发生?
1条答案
按热度按时间erhoui1w1#
我刚刚在我这边测试了一下,它似乎可以工作。我做了一个空白的新应用程序,在表单上放置了一个
TWebLabel
,并将完全相同的代码添加到按钮单击事件中,它将border-top
添加到标签中,如下图所示:x1c 0d1x的数据
所以,也许你的标签有一些其他的属性,阻止了
border-top
的工作?也许标签的边框/角超出了界限,所以边框就在那里,但你就是看不到它?
也可以删除标签并将其重新添加到表单中,然后重试。
下面的代码应该可以添加边框:
字符串
但是你也可以用下面的代码添加一个边框:
型
如果你使用Bootstrap:
型
border-top
仅用于使用Bootstrap的顶部边框。