كيف - تشكيل مع أيقونات
تعرف على كيفية إنشاء نموذج باستخدام الرموز.
يسجل
كيفية إنشاء نموذج رمز
الخطوة 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) أضف CSS:
مثال
* {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 الخاص بنا لمعرفة المزيد حول كيفية تصميم عناصر النموذج.
نصيحة: انتقل إلى البرنامج التعليمي CSS Flexbox الخاص بنا لمعرفة المزيد حول وحدة تخطيط الصندوق المرن.