...

View Full Version : Not giving button style



bucket
11-07-2009, 01:44 PM
I currently have this css:



input{
font-size:12px;
padding:4px 2px;
border:solid 1px #675f39;
}
</style>

and this form:


<form action="accounts-password.php" AUTOCOMPLETE = "off" method="POST">
<input type="hidden" name="member" value="1" />

<span style="float: left;">
Your old Password:
</span>
<span style="float: right;">
<input size="40" class="only" type="password" name="oldpass">
</span>
<br><br>
<hr>

<span style="float: left;">
Your New Password:
</span>
<span style="float: right;">
<input size="40" type="password" name="newpass">
</span>
<br><br>

<span style="float: left;">
Re-Type Your New Password:
</span>
<span style="float: right;">
<input size="40" type="password" name="veri">
</span>
<br><br>
<hr>
<center>
<input name="chpass" id="submit" type="submit" value="Change Password" >
</center>

</form>



I only want css style for the input textboxes like:

<input size="40" type="password" name="newpass">

For some reason Its giving me a css style for the submit button:

<input name="chpass" id="submit" type="submit" value="Change Password" >

How do I do it so the submit button stays default like with no css added to it, but the input text boxes still keep it?

I guess its because they are both starting with the '<input', not sure.

calebandchels
11-07-2009, 02:08 PM
Try giving all your inputs that you want changed a class and call the class in the CSS.

met
11-07-2009, 02:10 PM
as you say this is because submit starts with<input

two ways to rememdy this:

either:



input .textbox-only {
font-size:12px;
padding:4px 2px;
border:solid 1px #675f39;
}

<input class="textbox-only" size="40" type="password" name="newpass" />


or



input {
font-size:12px;
padding:4px 2px;
border:solid 1px #675f39;
}

input .button-no-style {
/* another style */
}

<input class="button-no-style" name="chpass" id="submit" type="submit" value="Change Password" >

use the later if you want a different style..if you want the default buttons, use the first example (class on textboxes)

bucket
11-07-2009, 02:23 PM
Its still giving me the same style as the input for the button-no-style

met
11-07-2009, 02:25 PM
like i said, you need to either specify another style for the submit button if you want it different than the text boxes, or use the first method (class applied to text boxes only) if you don't want any styling applied to the submit

apologies for any confusion



input .style {
font-size:12px;
padding:4px 2px;
border:solid 1px #675f39;
}
<input class="style" name="" type="text" /> /* styled */
<input type="submit" name="Submit" value="Submit" /> /* default */

bucket
11-07-2009, 02:42 PM
Okay, well I have done it my way and it works perfect.

I got a new problem:

I want this:


<span style="float: left;">
Main News Message:
</span>
<span style="align: right;">
<textarea style="border:solid 1px #675f39; padding:4px 2px;" name="mainnewsmessage" cols="40" rows="8">
<?php echo $row['mainnewsmessage']; ?>
</textarea>
</span>
<hr>

I want the textbox to align at the right, right now its not working and aligning right next to the 'Main News Message:' text.

It would work before:

<span style="float: left;">
Main News Message:
</span>
<span style="float: right;">
<textarea style="border:solid 1px #675f39; padding:4px 2px;" name="mainnewsmessage" cols="40" rows="5">
<?php echo $row['mainnewsmessage']; ?>
</textarea>
</span>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<hr>

But I would have to add alot of:

<br />
<br />
<br />
<br />
<br />
<br />
<br />
<hr> to it...

abduraooft
11-07-2009, 02:51 PM
input .style {
font-size:12px;
padding:4px 2px;
border:solid 1px #675f39;
} There shouldn't be any blank space before that period.

bucket
11-07-2009, 02:52 PM
so like?


input.style {
font-size:12px;
padding:4px 2px;
border:solid 1px #675f39;
}



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum