0

In Flex 4, I have a canvas that I'd like to set border-width on via css. I can set the border color and border style, but the border width remains 1 pixel wide no matter what.

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
           xmlns:s="library://ns.adobe.com/flex/spark" 
           xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Style source="global.css" />

<mx:Canvas id="login_panel" width="300" height="200">
    <s:Label text="hi there"/>
</mx:Canvas>

global.css:

#login_panel {
border-weight:5px;
border-color:#00ff00;
border-style:solid;

}

3
  • 1
    Is there a reason you can't use a BorderContainer there? It looks like borderThickness is not a supported style for Canvas if you are using the Spark theme. Aug 17, 2011 at 17:04
  • Looks like this is going to be the way to go. Thanks for your help Amy. Much appreciated.
    – steven
    Aug 17, 2011 at 17:30

3 Answers 3

1

have you tried border-thickness:5; ?

4
  • I get the same result when using border-thickness:5; Thanks for the suggestion tho...
    – steven
    Aug 17, 2011 at 16:47
  • @steven did you try with border-thickness:5px; too?
    – Sam DeHaan
    Aug 17, 2011 at 17:02
  • Yep. If i use border-thickness:5px; I get no border at all.
    – steven
    Aug 17, 2011 at 17:26
  • @steven Ah, well. Was just a guess. I haven't had this problem.
    – Sam DeHaan
    Aug 18, 2011 at 2:17
0

I believe your css is wrong. id="login_panel" should be styleName="login_panel" in your mxml. Then in your css #login_panel should be .login_panel.

Aside from that, you are using Flex 4 so you should use BorderContainer not Canvas.

4
  • Flex 4 CSS rules - Identifiers :: cookbooks.adobe.com/…
    – Sam DeHaan
    Aug 17, 2011 at 16:43
  • I don't think I deserve a down vote on this. Both syntaxes are valid, See "Global Selection" in your link. Aug 17, 2011 at 16:57
  • 1
    Both syntaxes are valid, but you told OP that his was wrong.
    – Sam DeHaan
    Aug 17, 2011 at 16:58
  • Fair enough. Then you should have said that. Aug 17, 2011 at 17:01
0

Have you tried the CSS property border-width?

Check out this web page for more info:

http://www.w3schools.com/cssref/pr_border-width.asp

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.