728x90

 

순수 html css로 공지사항 게시판 완성

이제 컨트롤러 및 db와 데이터 연결하면서

뷰에 주고 받는 속성과 컨트롤러 코드 스타트

 

HTML

<!DOCTYPE html>
<html lang="ko">
<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> 공지사항 </title>

<link rel="stylesheet" type="text/css" href="notice2css.css">
<script src="https://kit.fontawesome.com/76295929c4.js" crossorigin="anonymous"></script>



</head>
<body>
    <div class="container">

<!-- 헤더푸터는 클래스명 신경써야함
다른 페이지 임포트 되는거에는 css 선택자 적용안됨
메인 : 페이지가 달라지는거니 상관없다 -->

        <div class="main">
            <div class="infoContainer">
                <div class="titleArea">
                    <h3 >공지사항</h3>
                    <span>
                        TREND_EATER의 새로운 소식과 유용한 정보를 한곳에서 확인하세요
                    </span>
                </div>
                <!-- 테이블로 게시판 만들기!! -->
                <div>
                    <table>
                        <thead>
                           <tr>
                                <th>번호</th>
                                <th>제목</th>
                                <th>작성자</th>
                                <th>작성일</th>
                                <th>조회</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td width="50" nowrap="" align="center">1441 </td>        
                                <td style="padding-left:10px; text-align:left; color:#999">
                                    <a href=""><b>[마켓컬리] KURLY BIRTH WEEK 럭키기프트` 이벤트 당첨 안내</b></a><b></b></td>
                                <td width="100" nowrap="" align="center"> MarketKurly </td>
                                <td width="100" nowrap="" align="center" class="eng2">2022-05-23</td>
                                <td width="30" nowrap="" align="center" class="eng2">7629</td>
                            </tr>
                            <tr>
                                <td width="50" nowrap="" align="center">1443 </td>
                                    <td style="padding-left:10px; text-align:left; color:#999">
                                        <a href=""><b>마켓컬리 배송 안내</b></a><b></b></td>
                                    <td width="100" nowrap="" align="center">MarketKurly </td>
                                    <td width="100" nowrap="" align="center" class="eng2">2016-01-08</td>
                                    <td width="30" nowrap="" align="center" class="eng2">3172001</td>
                            </tr>
                            

                            <tr>
                                <td width="50" nowrap="" align="center">1442 </td>
                                <td style="padding-left:10px; text-align:left; color:#999">
                                    <a href=""><b>[마켓컬리] 포장재 회수 서비스 안내</b></a><b></b></td>
                                <td width="100" nowrap="" align="center">MarketKurly </td>
                                <td width="100" nowrap="" align="center" class="eng2">2021-06-18</td>
                                <td width="30" nowrap="" align="center" class="eng2">49299</td>
                            </tr>
                            <tr>
                                <td width="50" nowrap="" align="center">1441 </td>
                                <td style="padding-left:10px; text-align:left; color:#999">
                                    <a href="">[가격인상공지] [옥소] 굿그립 3종 핸드 스파이럴라이저 외 38건 (2022 6. 16 ~)</a></td>
                                <td width="100" nowrap="" align="center">MarketKurly </td>
                                <td width="100" nowrap="" align="center" class="eng2">2022-06-10</td>
                                <td width="30" nowrap="" align="center" class="eng2">46</td>
                            </tr>
                            <tr>
                                <td width="50" nowrap="" align="center">1440 </td>
                                <td style="padding-left:10px; text-align:left; color:#999">
                                    <a href="">[가격인상공지] [연세우유 x 마켓컬리] 전용목장우유 900mL (2022 6. 18 ~)</a></td>
                                <td width="100" nowrap="" align="center">MarketKurly </td>
                                <td width="100" nowrap="" align="center" class="eng2">2022-06-10</td>
                                <td width="30" nowrap="" align="center" class="eng2">53</td>
                            </tr>
                            <tr>
                                <td width="50" nowrap="" align="center">  1439 </td>
                                <td style="padding-left:10px; text-align:left; color:#999">
                                  <a href="">[가격인상공지] [제스파] 듀얼맥스태핑 발안마기 ZP1063 (2022 6. 15 ~)</a></td>
                                <td width="100" nowrap="" align="center">MarketKurly </td>
                                <td width="100" nowrap="" align="center" class="eng2">2022-06-10</td>
                                <td width="30" nowrap="" align="center" class="eng2">33</td>
                            </tr>
                            <tr>
                                <td width="50" nowrap="" align="center">  1439 </td>
                                <td style="padding-left:10px; text-align:left; color:#999">
                                  <a href="">[가격인상공지] [제스파] 듀얼맥스태핑 발안마기 ZP1063 (2022 6. 15 ~)</a></td>
                                <td width="100" nowrap="" align="center">MarketKurly </td>
                                <td width="100" nowrap="" align="center" class="eng2">2022-06-10</td>
                                <td width="30" nowrap="" align="center" class="eng2">33</td>
                            </tr>
                            <tr>
                                <td width="50" nowrap="" align="center">  1439 </td>
                                <td style="padding-left:10px; text-align:left; color:#999">
                                  <a href="">[가격인상공지] [제스파] 듀얼맥스태핑 발안마기 ZP1063 (2022 6. 15 ~)</a></td>
                                <td width="100" nowrap="" align="center">MarketKurly </td>
                                <td width="100" nowrap="" align="center" class="eng2">2022-06-10</td>
                                <td width="30" nowrap="" align="center" class="eng2">33</td>
                            </tr>
                            <tr>
                                <td width="50" nowrap="" align="center">  1439 </td>
                                <td style="padding-left:10px; text-align:left; color:#999">
                                  <a href="">[가격인상공지] [제스파] 듀얼맥스태핑 발안마기 ZP1063 (2022 6. 15 ~)</a></td>
                                <td width="100" nowrap="" align="center">MarketKurly </td>
                                <td width="100" nowrap="" align="center" class="eng2">2022-06-10</td>
                                <td width="30" nowrap="" align="center" class="eng2">33</td>
                            </tr>
                            <tr>
                                <td width="50" nowrap="" align="center">  1439 </td>
                                <td style="padding-left:10px; text-align:left; color:#999">
                                  <a href="">[가격인상공지] [제스파] 듀얼맥스태핑 발안마기 ZP1063 (2022 6. 15 ~)</a></td>
                                <td width="100" nowrap="" align="center">MarketKurly </td>
                                <td width="100" nowrap="" align="center" class="eng2">2022-06-10</td>
                                <td width="30" nowrap="" align="center" class="eng2">33</td>
                            </tr>

                        </tbody>
                            


                    </table>
                </div>
                

                <div class="boardSearchBox">
                    <div>
                        <span>검색어</span>
                        <ul>
                            <li><label><input type="checkbox">이름</label></li>
                            <li><input type="checkbox">제목</li>
                            <li><input type="checkbox">내용</li>
                        </ul>
                    </div>
                    <div class="searchBar">
                        <input type="search">
                        <input type="image" name="submit" src="search.png">
                    </div>
                </div>
            </div>
        </div>
        
        

       

    </div>
   
</body>
</html>

 

CSS

@import "reset.css";    
@import url(http://fonts.googleapis.com/earlyaccess/notosanskr.css); 


html, body {
    box-sizing: border-box;
}
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    
}

.main{
    width: 100%;
    display: flex;
    justify-content: center;
    font-family:'Noto Sans KR', sans-serif;
    
}

.main .infoContainer {
    flex-basis: 80%;
    height: 800px;
    background-color: white;
    
}
.infoContainer  table{
    margin: 0 auto;
} 

.titleArea{
    display: flex;
    /* justify-content: center; */
    gap: 3%; 
    align-items: center;
    padding: 2% 11%;
    width:820px;
    margin: 0 auto;
}
.titleArea > div{
    margin: 0 auto;
}
.titleArea > h3{
    font-size: 22px; font-weight: 500;
}
.titleArea > span{
    font-size: 13px; color:rgb(135, 133, 133);
}

.boardSearchBox {
    /* justify-content의 letf,right,center 위치 외에 세부조정하고 싶으면,
     justify-content: space-between으로 공백을 줘서 조정하면 됨*/
    display: flex;
    justify-content: space-between; /* space-between의 디폴트 범위지정값은 나머지 텍스트나 범위를 제외한 전부를 먼저 준다 */
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #FCD2D1;
    width:770px;
    margin: 0 auto;
}

.boardSearchBox > div {
    display: flex;
    gap: 10px;
}
.boardSearchBox span {
    font-size: x-small;
    padding-top: 5px;
    align-content: center;
    vertical-align: middle;
}

.boardSearchBox > div > ul {
    display: flex;
    /* justify-content: space-between;  */
    list-style: none;
    gap: 10px;
    font-size: smaller;
}
.boardSearchBox > div.searchBar{
    /* boardSearchBox 아래있는 div태그 중에 이름이 searchBar인 태그에만 적용 */
    display: flex;
    gap : 0px;

    
}
/* 
.boardSearchBox > div .searchBar
boardSearchBox 아래있는 div태그 자식 요소 중에 seachBar태그에만 적용  */

.searchBar > input{
    display: flex;
    border: 1px solid lightgray;
}

thead tr{
    width: 100%;
    height: 2rem;
        min-height: 20px;
        max-height: 50px;
    border-top: 2px solid rgb(254, 143, 143)  ;
    border-bottom: 2px solid #FE8F8F  ;
}
thead th{
    padding: 2% 1%;
    vertical-align: middle;
    text-align: center;
    font-size: small;
    font-weight: none;
}
tbody > tr{
    height: 2rem;
    /* border-top: 1px solid lightgray; */
    border-bottom: 1px solid lightgray;
    align-content: center;
    vertical-align: middle;
}
tbody > tr > td{
    height: 2rem;
    font-size: small;
    font-family: noto sans;
    align-content: center;
    vertical-align: middle;
    letter-spacing: 0px;
}
tbody td:nth-last-child(1){
    color: gray;
} 
tbody td:nth-last-child(2){
    color: gray;
} 
/* 뒤에서부터 4번째가 tr태그면 적용  // 태그 우선 */

 

728x90
반응형

+ Recent posts