Bootstrap 5 검색 예

오늘 튜토리얼에서는 부트스트랩 5에서 검색 상자를 사용하는 방법을 살펴보겠습니다. 이 섹션에서는 검색 입력 양식인 검색 표시줄을 볼 것입니다. 왼쪽 아이콘이 있는 검색 입력, 부동 상태 및 단일 테두리가 있는 검색 입력. 우리는 검색 아이콘 글꼴 멋진 6을 사용합니다.
view

Bootstrap 5 검색 상자 예



1) 부트스트랩 5 단순 검색창 형태.

<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Bootstrap 5 Search Example</title>
    <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">

  </head>

  <body>
    <div class="d-flex align-items-center justify-content-center vh-100 flex-column gap-4">
      <form class="d-flex">
        <input class="form-control me-1" type="search" placeholder="Search" aria-label="Search">
        <button class="btn btn-primary" type="submit">Search</button>
      </form>
      <form class="d-flex">
        <input class="form-control me-1" type="search" placeholder="Search" aria-label="Search">
        <button class="btn btn-outline-primary" type="submit">Search</button>
      </form>
      <form class="d-flex">
        <input class="form-control me-1" type="search" placeholder="Search" aria-label="Search">
        <button class="btn btn-success" type="submit">Search</button>
      </form>
    </div>
  </body>

</html>




2) 부트스트랩 5 왼쪽 검색창.

<form class="d-flex">
  <button class="btn btn-primary me-1" type="submit">Search</button>
  <input class="form-control" type="search" placeholder="Search" aria-label="Search">
</form>
<form class="d-flex">
  <button class="btn btn-outline-primary me-1" type="submit">Search</button>
  <input class="form-control" type="search" placeholder="Search" aria-label="Search">
</form>
<form class="d-flex">
  <button class="btn btn-success me-1" type="submit">Search</button>
  <input class="form-control" type="search" placeholder="Search" aria-label="Search">
</form>




3) fontawesome 6 아이콘이 있는 부트스트랩 5 검색 양식.

<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Bootstrap 5 Search box with Icon</title>
        <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
        <!-- fontawesome icon cdn -->
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.css">

    </head>

    <body>
        <div class="d-flex align-items-center justify-content-center vh-100 flex-column gap-4">
            <form class="d-flex">
                <input class="form-control me-1" type="search" placeholder="Search" aria-label="Search">
                <button class="btn btn-primary" type="submit">
                    <i class="fa-solid fa-magnifying-glass"></i>
                </button>
            </form>
            <form class="d-flex">
                <input class="form-control me-1" type="search" placeholder="Search" aria-label="Search">
                <button class="btn btn-outline-primary" type="submit">
                    <i class="fa-solid fa-magnifying-glass"></i>
                </button>
            </form>
            <form class="d-flex">
                <input class="form-control me-1" type="search" placeholder="Search" aria-label="Search">
                <button class="btn btn-success" type="submit">
                    <i class="fa-solid fa-magnifying-glass"></i>
                </button>
            </form>
        </div>
    </body>

</html>




4) 부트스트랩 5 테두리 없는 검색 상자.

<form class="d-flex">
  <input class="border border-3 border-top-0 border-start-0 border-end-0" type="search" placeholder="Search"
    aria-label="Search" style=" outline: none;">
  <button class="btn btn-primary" type="submit">Search </button>
</form




5) 부트스트랩 5 부동 검색 상자.

<form action="">
  <div class="form-floating mb-3 d-flex">
    <input type="search" class="form-control form-control" id="floatingInput" placeholder="Search Query">
    <label for="floatingInput">Search Query</label>
  </div>
</form>


또한 읽기



Bootstrap 5 Dark Mode Example
Bootstrap 5 File Upload Example
Bootstrap 5 Divider Line Example
Bootstrap 5 Login Form Page Example
Bootstrap 5 Gradient Button Example
Bootstrap 5 Card Slider with Splide JS Example
Bootstrap 5 Responsive Footer Section Example

좋은 웹페이지 즐겨찾기