방법 - 아이콘이 있는 양식
아이콘이 있는 양식을 만드는 방법을 알아보세요.
등록하다
아이콘 양식을 만드는 방법
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 자습서 로 이동 하십시오.