O'Reilly logo

Node.js Blueprints by Krasimir Tsonev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Styling a simple login form

We will now write the CSS styles for a simple login form. The HTML markup is pretty simple. It has two labels, two input fields, and two buttons, as shown in the following code:

<form method="post" id="login">
    <label>Your username</label>
    <input type="text" name="u" />
    <label>Your password</label>
    <input type="password" name="p" />
    <input type="submit" value="login" />
    <input type="button" value="forgot" />
</form>

The result that we want to achieve at the end looks like the following screenshot:

Styling a simple login form

As a preprocessor, we are going to use AbsurdJS and write our styles in the JavaScript format. Let's create an empty style.js ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required