Aligning text in <input> submit button

Discussion in 'HTML & Website Design' started by Devilfish, Nov 23, 2008.

  1. #1
    Hi folks,

    I'm trying to centre the text for a submit button but it always seems to align left.

    <input type="submit" value="Check" />
    Code (markup):
    Can anyone help please?

    Thanks :)
     
    Devilfish, Nov 23, 2008 IP
  2. jaaahn

    jaaahn Peon

    Messages:
    188
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It's a bit hard to tell without seeing the rest of your markup.
    Default is for text on input buttons to align center so something may be being inherited around it.

    I usually do it something like this
    
    html
    <input type="button" value="Submit" class="btn">
    
    Code (markup):
    then this should override to centred:
    
    css
    
    input.btn { 
    text-align: center;
    } 
    
    Code (markup):
     
    jaaahn, Nov 23, 2008 IP