[DAY - 24] input[type=text] 꾸미기

2023. 4. 5. 21:41·🔥 부트캠프-웹 개발 🔥/CSS3
  • input

1) input 꾸미기

    <style>
        .search-wrap {
            margin: 30px;
            width: 500px;
            height: 60px;
            background: tan;
            border-radius: 30px;
        }
        .search-wrap .search-form {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 60px;
        }
        .search-wrap .search-form input[type=text] {
            width: 400px;
            height: 50px;
            box-sizing: border-box;
            border: transparent;   
            background: transparent;   
        }
        .search-wrap .search-form input:focus {
            outline: none;
        }
        .search-wrap .search-form button {
            border: none;   
            background: transparent;  
        }
        .search-wrap .search-form button i {
            font-size: 30px;
        }

    </style>
</head>
<body>
    <div class="search-wrap">
        <form action="#" method="get" class="search-form">
            <label for="search" class="hide">검색</label>
            <input type="text" id="search" placeholder="검색어를 입력하세요" title="검색어 입력">
            <button>
                <i class="xi-search"></i>
            </button>
        </form>
    </div>
</body>

html로 button을 추가하고 xi 폰트 아이콘을 불러온다.

그리고 css로 기존의 input의 border과 background를 보이지 않게 하고 form을 감싸고 있는 div에 원하는 색을 추가한다.

 

    <style>
        .search-wrap {
            margin: 30px;

        }
        .search-wrap .search-form {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 60px;
        }
        .search-wrap .search-form select {
            border: none;
            width: 100px;
            height: 20px;
        }
        .search-wrap .search-form input[type=text] {
            height: 20px;
            width: 200px;
  
        }
        .search-wrap .search-form select:focus {
            outline: none;
        }
        .search-wrap .search-form button {
            margin-left: 5px;
            color: white;
            background: #000;
            border: none;
        }
        .search-wrap .search-form button i {
            display: flex;
            font-size: 20px;
            width: 20px;
            height: 25px;
            justify-content: center;
            align-items: center;
        }

    </style>
</head>
<body>
    <div class="search-wrap">
        
        <form action="#" method="get" class="search-form">
            <select>
                <option>전체</option>
                <option>제목</option>
                <option>제목/본문</option>
            </select>
            <label for="search" class="hide">검색</label>
            <input type="text" id="search" title="검색어 입력">
            <button>
                <i class="xi-search"></i>
            </button>
        </form>
    </div>
</body>

위와 같은 방식으로 xi 아이콘을 불러오고 기존 input의 css를 제거한다.

 

*

outline

        .search-wrap .search-form input:focus {
            outline: none;
        }

outline : none를 추가하면 input을 클릭했을 때 생기는 테두리를 제거할 수 있다.

'🔥 부트캠프-웹 개발 🔥/CSS3' 카테고리의 다른 글
  • [DAY - 65] SCSS
  • [DAY - 62] Media Query (반응형)
  • [DAY - 23] select 꾸미기, checkbox, radio박스 꾸미기
  • [DAY - 22] table
Yeonhub
Yeonhub
✨ https://github.com/yeonhub 📧 lsy3237@gmail.com
  • Yeonhub
    비 전공자의 Be developer
    Yeonhub
  • 전체
    오늘
    어제
    • 전체보기 (169)
      • 🔍 Tech 🔍 (19)
        • Front-End (11)
        • Back-End (4)
        • AI (1)
        • Server (1)
        • Etc (2)
      • 💡 원티드 프리온보딩 챌린지 💡 (14)
        • PRE-ONBOARDING_AI (11월) (1)
        • PRE-ONBOARDING_FE (2월) (2)
        • PRE-ONBOARDING_FE (1월) (2)
        • PRE-ONBOARDING_FE (12월) (9)
      • 🔥 부트캠프-웹 개발 🔥 (118)
        • HTML5 (7)
        • CSS3 (21)
        • JavaScript (27)
        • JavaScript_advanced (9)
        • React (24)
        • Next (1)
        • MYSql (5)
        • Node (5)
        • 오늘하날(개인프로젝트) (12)
        • 이젠제주투어(팀프로젝트) (7)
      • 💻 CS 💻 (1)
        • 알고리즘 (1)
      • ⚡ 코딩테스트 ⚡ (11)
        • JavaScript (11)
      • 📚 Books 📚 (6)
        • 클린 아키텍처 (2)
        • 인사이드 자바스크립트 (4)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

    • Github
  • 공지사항

  • 인기 글

  • 태그

    rn admob
    Node
    expo fcm
    react native expo fcm
    라스콘
    react native admob
    javascript fcm
    react native analytics
    python node
    react native bottom sheet
    expo map
    node fcm
    node crontab
    rn bottom sheet
    expo deep linking
    node.js fcm
    php node
    react vite
    라스콘4
    컴파운드 컴포넌트 패턴
    bottom sheet
    react native firebase analytics
    node cron
    expo node fcm
    프론트엔드 테스트코드
    expo admob
    expo fcm push
    expo 길찾기
    expo 지도
    expo google map
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
Yeonhub
[DAY - 24] input[type=text] 꾸미기
상단으로

티스토리툴바