Results 1 to 5 of 5

Thread: text-align on buttons

  1. #1
    Sencha User
    Join Date
    Jun 2011
    Location
    Los Angeles, CA
    Posts
    19

    Default text-align on buttons

    I'm trying to align the text on the button to the left, instead of the default center.
    I was able to do it by overriding .x-button-label class, but that changes all of the buttons. so I'd like to make a new css and not sure how to apply it to the text element.
    From looking around I've found that you can also apply an html tag to the text, but not sure how to apply it. When I tried adding the tag, it seems to only align it inside it's own element which didn't really move the text.
    PHP Code:
                       {xtype'button',
                        
    cls'home-button',
                        
    pressedCls'home-button-pressed',
                        
    text'feedback',
                        
    flex1,
                        
    icon'img/chevron.png',
                        
    iconAlign'right'
                       


  2. #2
    Sencha User
    Join Date
    Jun 2011
    Location
    Los Angeles, CA
    Posts
    19

    Default

    cmo'n guys,
    I assume somebody here knows how to make a button with a text aligned to the left instead of centered.
    I must be missing something so trivial, that nobody even bother answering.
    Help the noob please

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Location
    Germany
    Posts
    21

    Default

    Do you know it now?

  4. #4
    Sencha User
    Join Date
    Oct 2011
    Location
    Mumbai
    Posts
    19

    Thumbs up Use text-align in cls of button.

    Hi,

    You can secify text-align using cls property of button. You have specify home-button already. Just add another css
    like

    .home-button span{
    text-align:left;
    }
    or
    .home-button span{
    text-align:left;
    }

    Because sencha internally placed all button text wrapped by span tag. So you have specify text-align to span tag.While css of cls property will only applied to div used to create button not to span.

  5. #5
    Sencha User
    Join Date
    Aug 2011
    Location
    Germany
    Posts
    21

    Default

    Thanks! That solved my problem =))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •