Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HTML code

HTML
<form method="post" id= "form" action>
        <input type="text" id="email" name="email" value class="defaultText">
        <input type="submit" value="submit" id="submitButton">
</form>


CSS code

*{
margin:0;
p
CSS
<pre lang="CSS"><pre lang="c++"><pre lang="CSS">
adding:0;
}


/*-------------------------
General Styles
--------------------------*/


html{
background: #b0b0b0;
}

body {
background: #fff68f no-repeat center center;
font:14px/1.3 'Segoe UI',Arial, sans-serif;
}


form {
background: #181819;
display: block;
height: 31px;
padding: 10px;
position: relative;
width: 323px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}

#form {
color: rgb(238, 238, 238);
height: 31px;
position: relative;
width: 323px;
perspective-origin: 171.5px 25.5px;
transform-origin: 171.5px 25.5px;
background: rgba(24, 24, 25) none repeat scroll 0% 0% / auto padding-box border-box;
border: 0px none rgb(238, 238, 238);
border-radius: 3px 3px 3px 3px;
font: normal normal normal normal 15px/normal calibri Arial sans-serif;
margin: 0px 0px 0px -7px;
padding: 10px;
}

#submitButton {
background: url(submit_form.png) no-repeat right top;
border: none;
cursor: pointer;
height: 31px;
left: 236px;
line-height: 31px;
position: absolute;
text-indent: -99999px;
text-transform: uppercase;
top: 10px;
width: 96px;
}

#email {
background: url(submit_form.png) no-repeat;
border: none;
color: #888888;
height: 31px;
left: 10px;
line-height: 31px;
padding-left: 8px;
text-shadow: 1px 1px 0 #000000;
top: 10px;
width: 215px;
outline: none;
}
Posted
Comments
ramyajaya 4-Apr-15 22:20pm    
To make your content to the center of page inside form tag put a div enclosing all your other components and align that to center
Member 11581068 5-Apr-15 20:52pm    
Thank you but this would only affect the elements within... I need even the form tag itself, aligned. Please still help.

Try this

CSS
form {
margin: 0 auto;
width:250px;
}
 
Share this answer
 
Comments
Afzaal Ahmad Zeeshan 4-Apr-15 22:47pm    
+5
Member 11581068 5-Apr-15 20:54pm    
Thank you, but this didn't resolve it. Please still help.
For the form, use the following css
CSS
form {
  display: inline-block;
  text-align: center;
}
 
Share this answer
 
Comments
Member 11581068 5-Apr-15 11:33am    
Thanks but it didn't solve the problem. pls help out still. Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900