I am trying to do this on a TWebLabel, giving it a solid border of 5px and coloring it. I attempted to use .setProperty as mentioned in this post (How to make TWebPanel have rounded corners?) I attempted this on the TWebLabel (lblHome)
lblHome.ElementHandle.style.setProperty('border-top', '5px solid #da3b26');
But nothing happens?
I just tested this on my side and it seems to be working. I made a blank new app, placed a
TWebLabel
onto the form, and added the exact same code into a button click event and it's added theborder-top
to the label as can be seen by this image below:So perhaps your label has some other properties that are stopping the
border-top
from working?Maybe the label's border/corners are out of bounds, so the border is there, but you just can't see it?
Maybe also delete the label and re-add it to the form and then try again.
The below code should work to add a border:
But you can also add a border with the following code:
And if you're using Bootstrap:
border-top
for only the top border using Bootstrap.