Setting borders with CSS

There seems to be an issue with painting borders when set with CSS. 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;

they all look the same

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, though the above code sets them all visually to 3px and what I’m really after is all borders set to 2px!

This seems to affect all LAFs. I can of course override the CSS and set the border property directly but I want to be able to use the CSS to set borders if possible.

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

Hi David,

Although the Servoy developers do read the forums it’s recommended to file bug reports also in the support system at

http://crm.servoy.com/servoy-webclient/ … oy_support

This way they can track it and it won’t be overlooked.
You can refer back to this thread (or the original one).

Hope this helps.

Oops! - not thinking :oops: - thanks Robert

Hi David,

there are a lot of issues with CSS support in Servoy, caused by Sun’s outdated html-renderer. Have you searched the forum to see that your problem isn’t a variation of something reported earlier…

Hi Christian,

I did have a look before posting but didn’t turn up anything to do with problems in setting border width properties using CSS - if its there, I missed it!

Hi Christian,

David’s problems are not HTML related. This is the CSS that Servoy interprets itself to set the properties of form elements.
So this is something Servoy has total control over.

So this is something Servoy has total control over.

hmm, I am not 100% sure about that. I think they are using something standard instead of creating their own and there are some limitations.

I do think that Robert is right - it is to do with Servoy interpretation of the CSS. The problem I outlined at first soed not seem to be an issue in the web client, which correctly sets the borders according to the settings in the CSS. Its in the smart client that there are problems.

I can’t seem to be able to set the border color with css :(
There’s the sample css I’m trying to apply:

	border-width: 1px 2px 1px 1px;
	border-color: #FFFFFF #FFFFFF #FFFFFF #FFFFFF;

I tried applying it to each border separately but that doesn’t work either:

	border-top-width: 1px;
        border-top-color: #76836F;
        border-right-width: 1px;
	border-right-color: #76836F;
        border-bottom-width: 1px;
	border-bottom-color: #76836F;
        border-left-width: 1px;
	border-left-color: #76836F;

How do I set the color to my borders?

Cheers,
Maria

Hi Maria,

Add the following CSS property:

border-style: solid;

Or per side:

border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;

Hope this helps.