Saved X
Google login
SignUp with Email
X

Fa fa lock

In this, we learn how to show lock icon in font awesome, How do i increase its size and change color.

Use this icon with its unicode.

Use this icon with select tag.

Use this icon with textarea tag.

And also use this icon with a tag.

fa fa-lock
<i class="fa fa-lock"></i>
Example

fa fa-lock

increase icon size using inline css

increase icon size using font awesome classes

change icon color using inline css

use icon with html button tag

spin icon using font awesome fa-spin class

using unicode

Full Code
<!Doctype html>
<html>
<head>
	<title>font awesome lock icon</title>
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
	<h1 align="center">fa fa-lock</h1>
	
	<p>increase icon size using inline css</p>
	<p>
		<i class="fa fa-lock"></i>
		<i class="fa fa-lock" style="font-size:20px"></i>
		<i class="fa fa-lock" style="font-size:30px"></i>
		<i class="fa fa-lock" style="font-size:40px"></i>
		<i class="fa fa-lock" style="font-size:50px"></i>
	</p>
	
	<p>increase icon size using font awesome classes</p>
	<p>
		<i class="fa fa-lock"></i>
		<i class="fa fa-lock fa-2x"></i>
		<i class="fa fa-lock fa-3x"></i>
		<i class="fa fa-lock fa-4x"></i>
		<i class="fa fa-lock fa-5x"></i>
	</p>
	
	<p>change icon color using inline css</p>
	<p>
		<i class="fa fa-lock"></i>
		<i class="fa fa-lock fa-2x" style="color:red"></i>
		<i class="fa fa-lock fa-3x" style="color:blue"></i>
		<i class="fa fa-lock fa-4x" style="color:green"></i>
	</p>
	
	<p>use icon with html button tag</p>
	<p><button><i class="fa fa-lock" style="font-size:20px"></i> button</button></p>
	<p>spin icon using font awesome fa-spin class</p>
	<p><i class="fa fa-lock fa-spin" style="font-size:30px"></i></p>
	<p>using unicode</p>
	<p><i class="fa" style="font-size:25px"> &#xf023; </i></p>
</body>
</html>
Icon With Select Tag

With Select Tag

Code
<h1 align="center">with select tag</h1>
<select style="width:100%;height:50px">
	<option>check icon</option>
	<option class="fa" style="font-size:25px"> &#xf023; fa fa-lock</option>
</select>
Icon With Textarea Tag

With Textarea Tag

Code
<h1 align="center">with textarea tag</h1>
<textarea class="fa" style="width:100%;height:60px"> &#xf023; fa fa-lock</textarea>
Icon With Anchor Tag

With Anchor Tag

fa fa-lock
Code
<h1 align="center">with anchor tag</h1>
<a href="#"><i class="fa fa-lock"></i> fa fa-lock</a>

More icons