Jump to content

centering submit button


niche

Recommended Posts

Which property would be the easiest to use to center the the submit button under the input box in this script?Also, how do I change the styles of the submit button in this script?

div style="clear:both;margin-bottom:7px;"></div><div style="margin-left:60px;">  <div>    <form action="search.php" method="post">      <input type="text" name="search" /><br />      <input type="submit" value="Submit"  />    </form>  </div></div>

Link to comment
Share on other sites

<input style="color:blue;margin-left:40px;" type="submit" value="Submit" />That gets it centered and the test blue. How can change the color of the outline (the outline property won't do it) and the gray shading?

Link to comment
Share on other sites

give submit button id or class ref<input type="submit" value="Submit" id="mysubmitbut" />#mysubmitbut {border-width:0; /* OR border: 1px solid blue; */color:blue;margin-left:40px;background-color: green;}or use background image#mysubmitbut { border-width:0; color:blue; margin-left:40px; width:90px;height:25px; background:url (mysubmitbutbgimg.png) no-repeat; }always leave a space between right bracket and no-repeat, IE has issues in showing background image if these are butted together.

Link to comment
Share on other sites

using css to align center:

<div [b]style="text-align:center;"[/b]><input type="submit" value="Submit"></div>

using html tags to align center:

[b]<center>[/b]<input type="submit" value="Submit">[b]</center>[/b]

to change the style of the submit button:

<input type="submit" value="Submit" [b]style="color:red;...or whatever you want"[/b]>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...