Coder Social home page Coder Social logo

input-fields-with-fontawesome's Introduction

input-fields-with-fontawesome

Adding icons to your input fields (such as login or registration forms) gives the form a touch of personality and helps break up otherwise plain input fields.

Tutorial

For detailed instruction's, view Solodev's How to Add Font Awesome Icons to Your Input Fields article.

Demo

Try out a working example on JSFiddle.

HTML

The tutorial contains the following basic HTML markup.

 <section class="container min-container py-md-5 mt-4">
        <div class="card-panel p-sm-5 position-relative">
            <div class="text-center">
                <img src="https://raw.githubusercontent.com/solodev/input-fields-with-fontawesome/master/images/lunar-xp-logo.png" alt="Logo" class="img-fluid w-50">
                <h1 class="h2 mt-5">Welcome, Explorer!</h1>
            </div>
            <form id="loginForm" class="mt-5">
                  <p class="small mb-2 text-scarlet"></p>
              <div class="form-group position-relative">
                <label for="email" class="sr-only">Email</label>
                <input class="form-control input-lg rounded-0" id="email" name="email" type="text" placeholder="Email / Username" required="">
                <i class="fa fa-user fa-lg position-absolute"></i>
              <span style="opacity: 1; left: 502px; top: 14.5px; width: 19px; min-width: 19px; height: 13px; position: absolute;"></span></div>
              <label for="password" class="pull-left sr-only">Password</label>
              <div class="position-relative">
                <input class="form-control input-lg rounded-0" id="password" name="password" type="password" placeholder="Password" required="">
                <i class="fa fa-lock fa-lg position-absolute"></i>
              <span style="opacity: 1; left: 502px; top: 14.5px; width: 19px; min-width: 19px; height: 13px; position: absolute;"></span></div>
              <div class="text-center my-4">
                <button class="btn btn-primary text-white btn-lg text-uppercase" type="submit">Log in</button>
              </div>
            </form>
            </div>
          </div>      
 </section>

CSS

All required CSS is contained with style.css

External Resources

This tutorial includes the following third party resources.

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">

input-fields-with-fontawesome's People

Contributors

paristuzun avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.