3화. input 텍스트 창에도 색상을 반영할 수 있었구나!

Nian·2022년 4월 18일
0

축하프로젝트

목록 보기
3/3

이 부분을 자연스럽게 하기 위해서 css 속성이 있는지 구글을 통해 찾았고,

http://gnujava.com/board/article_view.jsp?article_no=341&board_no=11&table_cd=EPAR04&table_no=04

이 글을 통해서 해결을 했다.

그래서 이 부분은 이런 식으로 구현을 했다.

html

  • textareainput 태그는 아쉽게도 내가 만든 것이 아니다. 남이 쓴 걸 그대로 베껴왔다.
        <div class="mypost">
            <input type="text" id="name" class="form-control" placeholder="닉네임">
            <textarea class="form-control" id="" cols="30" rows="10" placeholder="생일축하 멘트" maxlength="400"></textarea>
            <button>메시지 남기기</button>
        </div>

css

  • 남이 쓰던 코드 그대로 뜯어오고 난 다음에 자세히 봤는데 부트스트랩의 폼과 유사했다. 내가 할 수 있었던 건 다시 개별 지정을 해야하는 것?
    현재 내 실력은 어느 코드가 어떤 식으로 중복이 되어 있는지 잘 몰라서 크롬이 알아서 잡아주기를 기도하는 것 뿐이다.
    (링크 : https://getbootstrap.kr/docs/5.1/forms/overview/)
.mypost>input {
    margin-bottom: 20px;
    background-color: transparent;
    color: white;
}

.mypost>textarea {
    height: 300px;
    resize: none;
    background-color: transparent;
    color: white;
}

.form-control {
    display: block;
    width: 100px;
    font-size: 1rem;
    --bs-blue: #0d6efd;
    --bs-indigo: #6610f2;
    --bs-purple: #6f42c1;
    --bs-pink: #d63384;
    --bs-red: #dc3545;
    --bs-orange: #fd7e14;
    --bs-yellow: #ffc107;
    --bs-green: #198754;
    --bs-teal: #20c997;
    --bs-cyan: #0dcaf0;
    --bs-white: #fff;
    --bs-gray: #6c757d;
    --bs-gray-dark: #343a40;
    --bs-primary: #0d6efd;
    --bs-secondary: #6c757d;
    --bs-success: #198754;
    --bs-info: #0dcaf0;
    --bs-warning: #ffc107;
    --bs-danger: #dc3545;
    --bs-light: #f8f9fa;
    --bs-dark: #212529;
    --bs-font-sans-serif: system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
    --bs-font-monospace: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
    --bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
    margin: 0;
    font-family: inherit;
    display: block;
    width: 100%;
    font-size: 1rem;
    font-weight: 400;
    color: #212529;
    /* background-color: #fff; */
    background-clip: padding-box;
    border: 1px solid #ced4da;
    appearance: none;
    border-radius: .25rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
    height: calc(3.5rem + 2px);
    line-height: 1.25;
    padding: 1rem .75rem;
}

후기

왕뿌듯

이제 CRUD와 친해질 때가 되었다.

profile
무언가를 하고 있지만, 잘 안될 수 있습니다.

0개의 댓글