Centering button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sayub
    New Member
    • Apr 2010
    • 10

    Centering button

    Hello I have the following line of code trying to center the submit button. But it does not work.

    <p><input type = "submit" value = "Submit" align="center" >

    Please help...
  • ThatThatGuy
    Recognized Expert Contributor
    • Jul 2009
    • 453

    #2
    Originally posted by sayub
    Hello I have the following line of code trying to center the submit button. But it does not work.

    <p><input type = "submit" value = "Submit" align="center" >

    Please help...
    Why dont you try <center>

    Comment

    • drhowarddrfine
      Recognized Expert Expert
      • Sep 2006
      • 7434

      #3
      <center> is deprecated. Never use it.

      <input> is an inline element and the (also deprecated) align attribute won't work here. You must make it 'display:block' and use CSS 'margin:0 auto'.

      Comment

      • Denburt
        Recognized Expert Top Contributor
        • Mar 2007
        • 1356

        #4
        Just tossing this in http://www.w3schools.com/css/css_intro.asp

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          Don't be too rough, centering an object is continuely my biggest frustration.
          Since a certain browser or 2 seem to do other things when using the margin attribute

          Comment

          Working...