Creating Icons in PHP

Introduction

In this article I explain creation of an icon in PHP using the Twitter bootstrap file. This is a very simple. You can easily make an icon using the Twitter bootstrap file. The Twitter bootstrapping file is very important for creating icons. Use this URL: http://twitter.github.com to download the Twitter Bootstrap file.

Example

The following is the search form:

<html>

  <head>  

    <title>using icons in search form </title>  

    <!-- Le styles --> 

    <link href="twitter-bootstrap-v2/docs/assets/css/bootstrap.css" rel="stylesheet"> 

    <style type="text/css"> 

    form

       { 

    margin-top: 50px

    } 

    </style> 

    <!-- <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>  -->           

    <!-- Le fav and touch icons --> 

    <link rel="shortcut icon" href="twitter-bootstrap-v2/docs/examples/images/favicon.ico"> 

    <link rel="apple-touch-icon" href="twitter-bootstrap-v2/docs/examples/images/apple-touch-icon.png"> 

    <link rel="apple-touch-icon" sizes="72x72" href="twitter-bootstrap-v2/docs/examples/images/apple-touch-icon-72x72.png"> 

    <link rel="apple-touch-icon" sizes="114x114" href="twitter-bootstrap-v2/docs/examples/images/apple-touch-icon-114x114.png"> 

  </head> 

  <body> 

    <div class="container"> 

    <div class="row"> 

    <div class="span12"> 

      <form class="well form-search"> 

          <input type="text" class="input-medium search-query"> 

          <button type="submit" class="btn"><i class="icon-search"></i> Search</button> 

      </form> 

    </div> 

    </div> 

    <footer> 

     <p>© Copywrite 2013</p> 

    </footer> 

    </div> 

</body> 

</html>

Output

icon3.jpg

Example

The following is the navigation bar:

<html> 

  <head>  

    <title>Example icons in navigation with Twitter Bootstrap</title>   

    <!-- Le styles --> 

    <link href="twitter-bootstrap-v2/docs/assets/css/bootstrap.css" rel="stylesheet"> 

     <!-- <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script> -->

    <!-- Le fav and touch icons --> 

    <link rel="shortcut icon" href="twitter-bootstrap-v2/docs/examples/images/favicon.ico"> 

    <link rel="apple-touch-icon" href="twitter-bootstrap-v2/docs/examples/images/apple-touch-icon.png"> 

    <link rel="apple-touch-icon" sizes="80x80" href="twitter-bootstrap-v2/docs/examples/images/apple-touch-icon-80x80.png"> 

    <link rel="apple-touch-icon" sizes="114x114" href="twitter-bootstrap-v2/docs/examples/images/apple-touch-icon-114x114.png"> 

  </head> 

  <body> 

    <div class="navbar navbar-fixed-top"> 

    <div class="navbar-inner"> 

    <div class="container"> 

    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> 

    <span class="icon-bar"></span> 

    <span class="icon-bar"></span> 

    <span class="icon-bar"></span> 

    </a> 

    <a class="brand" href="#">csharp</a> 

    <div class="nav-collapse"> 

    <ul class="nav"> 

    <li class="active"><a href="#"><i class="icon-user icon-white"></i> Home</a></li> 

    <li><a href="#about"><i class="icon-user icon-white"></i> User</a></li> 

    <li><a href="#about"><i class="icon-download icon-white"></i> Downlaod</a></li> 

    <li><a href="#about"><i class="icon-upload icon-white"></i>Upload</a></li> 

    <li><a href="#about"><i class="icon-play-circle  icon-white"></i>Play Circle</a></li> 

    <li><a href="#about"><i class="icon-bookmark  icon-white"></i>Bookmark</a></li> 

    <li><a href="#about"><i class="icon-gift icon-white"></i>Gift</a></li> 

    </ul> 

    </div>

    </div> 

    </div> 

    </div> 

  <hr> 

    </div> 

    <!-- Placed at the end of the document so the pages load faster --> 

    <script src="twitter-bootstrap-v2/docs/assets/js/jquery.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-transition.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-alert.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-modal.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-dropdown.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-scrollspy.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-tab.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-tooltip.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-popover.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-button.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-collapse.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-carousel.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-typeahead.js"></script> 

  </body> 

</html> 

 

Output


icon4.jpg

 

 

Example

 

Next, I will create icons in buttons. This example is very useful for making attractive buttons.

 

<!DOCTYPE html> 

<html lang="en"> 

  <head> 

    <title>using icons in buttons and button groups</title> 

    <!-- Le styles --> 

    <link href="twitter-bootstrap-v2/docs/assets/css/bootstrap.css" rel="stylesheet"> 

    <style type="text/css"> 

    form

       { 

    margin-top: 50px

    } 

    </style> 

    <!-- Le fav and touch icons --> 

    <link rel="shortcut icon" href="twitter-bootstrap-v2/docs/examples/images/favicon.ico"> 

    <link rel="apple-touch-icon" href="twitter-bootstrap-v2/docs/examples/images/apple-touch-icon.png"> 

    <link rel="apple-touch-icon" sizes="72x72" href="twitter-bootstrap-v2/docs/examples/images/apple-touch-icon-72x72.png"> 

    <link rel="apple-touch-icon" sizes="114x114" href="twitter-bootstrap-v2/docs/examples/images/apple-touch-icon-114x114.png"> 

  </head> 

  <body> 

    <div class="container"> 

    <div class="row"> 

    <div class="span4"> 

    <div class="btn-toolbar" style="margin-bottom: 9px"> 

    <div class="btn-group"> 

    <a class="btn" href="#"><i class="icon-align-left"></i></a> 

    <a class="btn" href="#"><i class="icon-align-center"></i></a> 

    <a class="btn" href="#"><i class="icon-align-right"></i></a> 

    <a class="btn" href="#"><i class="icon-align-justify"></i></a> 

    </div> 

    <div class="btn-group"> 

    <a class="btn btn-primary" href="#"><i class="icon-user icon-white"></i>User</a> 

    <a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a> 

    <ul class="dropdown-menu"> 

    <li><a href="#"><i class="icon-pencil"></i>Edit</a></li> 

    <li><a href="#"><i class="icon-trash"></i>Delete</a></li> 

    <li><a href="#"><i class="icon-ban-circle"></i>Ban</a></li> 

    <li class="divider"></li> 

    <li><a href="#"><i class="i"></i>Make admin</a></li> 

    </ul> 

    </div> 

    </div> 

    <p> 

    <a class="btn" href="#"><i class="icon-refresh"></i> Refresh</a> 

    <a class="btn btn-success" href="#"><i class="icon-shopping-cart icon-white"></i> Checkout</a> 

    <a class="btn btn-danger" href="#"><i class="icon-trash icon-white"></i> Delete</a> 

    </p> 

      <p> 

      <a class="btn btn-large" href="#"><i class="icon-comment"></i> Comment</a> 

      <a class="btn btn-small" href="#"><i class="icon-cog"></i> Settings</a> 

      <a class="btn btn-small btn-info" href="#"><i class="icon-info-sign icon-white"></i> More Info</a> 

      </p> 

    </div> 

    </div> 

    </div> 

     <!-- Placed at the end of the document so the pages load faster --> 

    <script src="twitter-bootstrap-v2/docs/assets/js/jquery.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-transition.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-alert.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-modal.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-dropdown.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-scrollspy.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-tab.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-tooltip.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-popover.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-button.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-collapse.js"></script> 

    <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-carousel.js"></script> 

   <script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-typeahead.js"></script> 

</body> 

</html>

Output

icon1.jpg

icon2.jpg

Up Next
    Ebook Download
    View all
    Learn
    View all