If this tutorial is not what you were looking for, you still have any questions, suggestions or concerns - feel free to let us know. Please help us to serve you better!

Your Name

Your Email

Your Message (required)

captcha

JS Animation. How to assign specific background for element on focus event

Hi! In this tutorial we’ll show how to assign specific background for element on focus event in JS Animated templates.

JS Animation. How to assign specific background for element on focus event

  1. :focus is a CSS pseudo class that changes the style of element when it was clicked on by the mouse or tabbed. Let’s change the on focus background of textfield in contact form:

    How to assign specific background for element on focus event1

  2. Inspect the needed element with developers tool like Firebug and add a rule for it:

    How to assign specific background for element on focus event2

  3. Add a :focus to the element selector and add background:

    How to assign specific background for element on focus event3

  4. Copy the rule to the bottom of your style.css file and save it:

    How to assign specific background for element on focus event4

  5. Refresh the page and click on the text field to see the changes:

    How to assign specific background for element on focus event5

Now you know how to assign specific background for element on focus event. Feel free to check detailed video tutorial below.

Feel free to check the detailed video tutorial below:

JS Animation. How to assign specific background for element on focus event