Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Sep 2008
    Posts
    697
    Thanks
    8
    Thanked 17 Times in 16 Posts

    Not giving button style

    I currently have this css:

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

    Code:
    <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:
    Code:
    <input size="40" type="password" name="newpass">
    For some reason Its giving me a css style for the submit button:
    Code:
    <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.
    MY MSN: Sith717@Hotmail.com
    PHP, HTML, and CSS Coding, Logo and Web Design - Professionally done.
    PM me anytime for HTML, PHP or web design help. I will be glad to help you out.

  • #2
    Regular Coder
    Join Date
    Nov 2009
    Location
    Florida United States
    Posts
    105
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Give spans classes

    Try giving all your inputs that you want changed a class and call the class in the CSS.
    Last edited by calebandchels; 11-07-2009 at 02:08 PM. Reason: bad spelling

  • #3
    met
    met is offline
    Regular Coder
    Join Date
    Oct 2009
    Location
    United Kingdom
    Posts
    728
    Thanks
    4
    Thanked 119 Times in 119 Posts
    as you say this is because submit starts with<input

    two ways to rememdy this:

    either:

    Code:
    input .textbox-only {
        font-size:12px;
        padding:4px 2px;
        border:solid 1px #675f39;
    }
    
    <input class="textbox-only" size="40" type="password" name="newpass" />
    or

    Code:
    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)

  • #4
    Regular Coder
    Join Date
    Sep 2008
    Posts
    697
    Thanks
    8
    Thanked 17 Times in 16 Posts
    Its still giving me the same style as the input for the button-no-style
    MY MSN: Sith717@Hotmail.com
    PHP, HTML, and CSS Coding, Logo and Web Design - Professionally done.
    PM me anytime for HTML, PHP or web design help. I will be glad to help you out.

  • #5
    met
    met is offline
    Regular Coder
    Join Date
    Oct 2009
    Location
    United Kingdom
    Posts
    728
    Thanks
    4
    Thanked 119 Times in 119 Posts
    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

    Code:
    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 */

  • #6
    Regular Coder
    Join Date
    Sep 2008
    Posts
    697
    Thanks
    8
    Thanked 17 Times in 16 Posts
    Okay, well I have done it my way and it works perfect.

    I got a new problem:

    I want this:

    Code:
    <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:
    Code:
    <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:
    Code:
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <hr>
    to it...
    Last edited by bucket; 11-07-2009 at 02:47 PM.
    MY MSN: Sith717@Hotmail.com
    PHP, HTML, and CSS Coding, Logo and Web Design - Professionally done.
    PM me anytime for HTML, PHP or web design help. I will be glad to help you out.

  • #7
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,849
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Quote Originally Posted by met
    Code:
    input .style {
        font-size:12px;
        padding:4px 2px;
        border:solid 1px #675f39;
    }
    There shouldn't be any blank space before that period.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #8
    Regular Coder
    Join Date
    Sep 2008
    Posts
    697
    Thanks
    8
    Thanked 17 Times in 16 Posts
    so like?

    Code:
    input.style {
        font-size:12px;
        padding:4px 2px;
        border:solid 1px #675f39;
    }
    MY MSN: Sith717@Hotmail.com
    PHP, HTML, and CSS Coding, Logo and Web Design - Professionally done.
    PM me anytime for HTML, PHP or web design help. I will be glad to help you out.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •