1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

individual colours for the "login/register" fields

Discussion in 'Styling and Customization Questions' started by snoopy5, Oct 16, 2012.

  1. snoopy5

    snoopy5 Well-Known Member

    Hi

    I want to use other colours than anywhere else in the forum for the "login/register" formular. How can I do this?
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    Each of the fields on the login/register form have a unique ID.

    You could style them in EXTRA.css by referencing the ID of the element (rather than the class).

    e.g.

    #id_ctrl_email
    {
    background-color: red;
    }

    Would give the Email field only a red background.
     
    Jake Bunce likes this.
  3. snoopy5

    snoopy5 Well-Known Member

    Thanks. That sound good. Where can I find a list of all those IDs?
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    Use a decent browser such as Chrome or Firefox.

    Right click the field and select "Inspect Element" from the menu.

    You will then be shown the HTML code which pertains to that field.

    So something like:
    <input type="text" class="textCtrl" name="email" id="id_ctrl_email" />

    id_ctrl_email is the ID so you would reference that in css with

    #id_ctrl_email
     
    Jake Bunce likes this.
  5. snoopy5

    snoopy5 Well-Known Member

    Thanks, I get the id with this, but it seems to be the wrong code for the background. Nothing changes.
     
  6. Chris D

    Chris D XenForo Developer Staff Member

    My example was wrong.

    The id for the email field is actually just "ctrl_email".

    So EXTRA.css containing:

    #ctrl_email
    {
    background-color: red;
    }

    Would make the email field red.

    [​IMG]
     
    Jake Bunce likes this.
  7. snoopy5

    snoopy5 Well-Known Member

    thanks. That did it...
     

Share This Page