CSS border width issue

I want to set the border of fields in my CSS to 2px so I use

border-width: 2px 2px 2px 2px;
border-style: solid;

but this gives results where the left and top borders are not the same as the right and bottom borders - they look bigger! This seems to be the case for larger sizes also - the left and top borders do not have the same size as the right and bottom even when set to the same values

However, if I use ```
border-width: 1px 1px 1px 1px;


I can only get them all to look the same at larger sizes if I use for example ```
border-width: 2px 3px 3px 2px;
``` ... i.e. set the right and bottom to 1px larger. 

This does not seem to make sense to me but if anyone has an explanation I would love to hear it!

Servoy Developer
Version 3.5.1-build 514
Java version 1.5.0_07-87 (Mac OS X)

Hi David,

Sounds to me this is a bug/paint issue.
Do you see the same result with other LAF’s as well?

Also to narrow things down, do you see the same with setting the border property of the field to Matte with the sides set to 2px?

Hi Robert,

Yes it seems to affect other LAFs as well - Kunsthoff, Metal. It seems that the border property is not always displayed correctly. Is it possible that the default field display used by servoy where the left and top borders are inset in appearance is somehow interfering with the border setting in the CSS and adding extra width to the left and top borders at anything larger than a 1px setting?

I don’t think I can use matte in the CSS and if I set the field border to matte then that overrides the CSS border setting anyway which does away with the advantage of using the CSS to set border properties in the first place - I would then have to set all field borders manually :cry:

But to answer your question, if I do use the matte setting directly then I can happily set all borders to 2px and it works.

Hi Dave,

I know setting the property directly on the field defeats the purpose of using CSS. But it was more an exercise to narrow down the problem.
I suggest you file a bug-report in the servoy support system for this.

Hi Robert,

OK - I’ll file a report. Thanks for the help :)