कैसे करें - चिह्नों के साथ फॉर्म
आइकॉन से फ़ॉर्म बनाने का तरीका जानें.
रजिस्टर करें
आइकन फॉर्म कैसे बनाएं
चरण 1) HTML जोड़ें:
इनपुट को प्रोसेस करने के लिए <form> एलीमेंट का इस्तेमाल करें। आप इसके बारे में हमारे PHP ट्यूटोरियल में अधिक जान सकते हैं । फिर प्रत्येक फ़ील्ड के लिए इनपुट जोड़ें:
उदाहरण
<form action="/action_page.php">
<h2>Register Form</h2>
<div class="input-container">
<i class="fa fa-user
icon"></i>
<input class="input-field" type="text"
placeholder="Username" name="usrnm">
</div>
<div
class="input-container">
<i class="fa fa-envelope
icon"></i>
<input class="input-field" type="text"
placeholder="Email" name="email">
</div>
<div
class="input-container">
<i class="fa fa-key
icon"></i>
<input class="input-field" type="password"
placeholder="Password" name="psw">
</div>
<button
type="submit" class="btn">Register</button>
</form>
चरण 2) सीएसएस जोड़ें:
उदाहरण
* {box-sizing: border-box;}
/* Style the input container */
.input-container {
display: flex;
width: 100%;
margin-bottom: 15px;
}
/* Style the form
icons */
.icon {
padding:
10px;
background: dodgerblue;
color: white;
min-width: 50px;
text-align: center;
}
/* Style the input
fields */
.input-field {
width: 100%;
padding:
10px;
outline: none;
}
.input-field:focus {
border: 2px solid
dodgerblue;
}
/* Set a style for the submit button */
.btn {
background-color: dodgerblue;
color: white;
padding: 15px
20px;
border: none;
cursor: pointer;
width:
100%;
opacity: 0.9;
}
.btn:hover {
opacity: 1;
}
युक्ति: HTML प्रपत्रों के बारे में अधिक जानने के लिए हमारे HTML प्रपत्र ट्यूटोरियल पर जाएँ।
टिप: तत्वों को स्टाइल करने के तरीके के बारे में अधिक जानने के लिए हमारे सीएसएस फॉर्म ट्यूटोरियल पर जाएं।
युक्ति: लचीले बॉक्स लेआउट मॉड्यूल के बारे में अधिक जानने के लिए हमारे CSS Flexbox Tutorial पर जाएं।