728x90

 

관리자 페이지에서 공지사항 작성할 수 있게 쓰기 페이지 제작

인풋태그로 짧은 글 받고

텍스트 애어리어로 내용 부분 받아서 컨트롤러로 전달

쓰기 폼하나 새로 만들고 이를 작성완료하면 db쪽과 왔다갔다 하도록 구성

 

HTML

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>


<link rel="stylesheet" type="text/css" href="${ pageContext.servletContext.contextPath }/resources/css/admin/adminNoticeWriteView.css">



</head>
<body>

	<c:import url="adminMenubar.jsp" />



    <div class="title">
        <h2>공지사항</h2>   
    </div>    
    
	<form id="form" name="form" method="post">
	    <table class="tableWhole">
	            <thead>
	                <tr>
	                    <th>제목</th>
	                        <td style="width: 1050px;">
	                        	<input type="text" placeholder="제목을 입력하세요">
	                        </td>
	                </tr>
	                <tr>
	                    <th>작성자</th>
	                    <td>${board.adminId}</td>
	                </tr>
	                <tr>
	                    <th>작성일</th>
	                    <td>${board.boardCreateDate}</td>
	                    <th>조회수</th>
	                    <td style="width:100px" align="center">
	                    	${board.boardCount}
	                    </td>
	                </tr>
	            </thead>
	    </table>
    

	    <div class="content">
	        <textarea class="textarea_field" placeholder="   내용을 입력해주세요."></textarea>
	    </div>
			<input type="hidden" id="boardId" name="boardId" value="${board.boardId }" > <!-- qnaNo를 컨트롤러로 보내서 어느 게시물이 수정되는지 알려 줘야함  -->
	    <div class="listButton">
	    	<c:url var="blist" value="adminNoticeList.ad">
				<c:param name="page" value="${ page }"/>
			</c:url>
	        <button type="submit" onclick="javascript:form.action='adminNoticeWriteForm.ad'">작성 완료</button> 
	        <button type="submit" onclick="javascript:form.action='adminNoticeList.ad'">목 록</button> 
	    </div>
	 </form> 
    




<!-- ############ PAGE END 끝~ -->

<!-- / -->

<!-- theme switcher -->

<!-- ############ LAYOUT END-->

<!-- build:js scripts/app.html.js -->
<!-- jQuery -->
<script src="${ pageContext.servletContext.contextPath }/resources/libs/jquery/jquery/dist/jquery.js"></script>
<!-- Bootstrap -->
<script src="${ pageContext.servletContext.contextPath }/resources/libs/jquery/tether/dist/js/tether.min.js"></script>
<script src="${ pageContext.servletContext.contextPath }/resources/libs/jquery/bootstrap/dist/js/bootstrap.js"></script>
<!-- core -->
<script src="${ pageContext.servletContext.contextPath }/resources/libs/jquery/underscore/underscore-min.js"></script>
<script src="${ pageContext.servletContext.contextPath }/resources/libs/jquery/jQuery-Storage-API/jquery.storageapi.min.js"></script>
<script src="${ pageContext.servletContext.contextPath }/resources/libs/jquery/PACE/pace.min.js"></script>

<script src="${ pageContext.servletContext.contextPath }/resources/scripts/config.lazyload.js"></script>

<script src="${ pageContext.servletContext.contextPath }/resources/scripts/palette.js"></script>
<script src="${ pageContext.servletContext.contextPath }/resources/scripts/ui-load.js"></script>
<script src="${ pageContext.servletContext.contextPath }/resources/scripts/ui-jp.js"></script>
<script src="${ pageContext.servletContext.contextPath }/resources/scripts/ui-include.js"></script>
<script src="${ pageContext.servletContext.contextPath }/resources/scripts/ui-device.js"></script>
<script src="${ pageContext.servletContext.contextPath }/resources/scripts/ui-form.js"></script>
<script src="${ pageContext.servletContext.contextPath }/resources/scripts/ui-nav.js"></script>
<script src="${ pageContext.servletContext.contextPath }/resources/scripts/ui-screenfull.js"></script>
<script src="${ pageContext.servletContext.contextPath }/resources/scripts/ui-scroll-to.js"></script>
<script src="${ pageContext.servletContext.contextPath }/resources/scripts/ui-toggle-class.js"></script>

<script src="${ pageContext.servletContext.contextPath }/resources/scripts/app.js"></script>

<!-- ajax -->
<%-- 	<script src="${ pageContext.servletContext.contextPath }/resources/libs/jquery/jquery-pjax/jquery.pjax.js"></script> --%>
<script src="${ pageContext.servletContext.contextPath }/resources/scripts/ajax.js"></script>
<!-- endbuild -->
    


</body>
</html>

 

CSS




th{
    width: 130px;
    background-color: #f7f5f8;
    font-weight: 600;
    line-height: 200%;
}

input{
	border:none;
}

.title{
    width: 890px;
    text-align: center;
    margin: 0 auto;
}
.title > p{
    color:rgb(149, 146, 146);
    margin-bottom: 3%;
}
thead{
    border-bottom: rgb(149, 146, 146);
}

.tableWhole{
    width:100%;
    max-width: 890px;
    border-top : 2px solid black;  
    border-bottom: 1px solid lightgray;
    line-height: 180%;
    margin: 0 auto;
}
.tableWhole > thead > tr > td{
	padding-left:10px;	
	padding-top:5px;
	padding-bottom:5px;
	
}
thead > tr{
    border-bottom : 1px solid rgb(149, 146, 146);  
}
.tableTop td{
    width:450px;
}

    
.content{
    width:890px;
    margin: 0 auto;
    word-break: break-all;
}
.content > p{
    padding: 2%;
    padding-bottom: 5%;
    border-bottom: 1px solid  lightgray;
}

.listButton{
    width:890px;
    text-align: right;
    margin:2% auto;
    padding-right: 3%;
    
}
.listButton > button:hover{
    background-color:#f7b7b5;
    color:#fff;
    border:1px solid #FE8F8F;
    
}
.listButton > button{
    width:100px;
    height:35px;
    background-color: #FE8F8F;
    border: 1px solid #FF5C58;
    color:#fff;
}

/**************************/

.content{
    text-align: center;
}
.content textarea{
    width:890px;
    min-height: 150px;
    padding:1% 0;
    margin: 0 auto;
    resize: none;
    border:none;
    border-bottom: 1px solid lightgray;
}

 

 

728x90
반응형
728x90

 

세션 영역에 있는 관리자 로그인 정보 중에 id만 가져와서

admin 테이블로 casting하고 다시 보드 테이블에 넣어주어 이를 공지사항 쓰기할 때

고정적으로 작성자에 보여주는걸로 코드 수정 및 기능 추가

 

	@RequestMapping("adminNoticeWriteView.ad")
	public String adminNoticeWriteView() {
		return "adminNoticeWriteView";
	}

 

	@RequestMapping("adminNoticeWriteView.ad")
	public String adminNoticeWriteView(@ModelAttribute Board b, Model model, HttpSession session) {
		
		String adId = ((Admin)session.getAttribute("adminUser")).getId();
		b.setAdminId(adId);
		model.addAttribute("b",b);
		
		return "adminNoticeWriteView";
	}

 

728x90
반응형
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
반응형
728x90

마켓컬리 UI 본따와서 공지사항 만들기

테이블 및 하단 검색 쪽 센터정렬

글씨 색, 크기 및 위치조절

flex, padding

margin 0 auto로 센터정렬

인라인스타일 CSS 줄이고 외부스타일로

 

센터정렬 방법 : margin 0 auto
    부모태그의 넓이를 모르는데 자식태그가 어떤걸 기준을 줄지 모르기 때문에
        부모태그의 width100%를 설정해줘야함

        이미지 크기 조절 방법1
        미디어쿼리
        미디어쿼리로 웹사이트 크기마다 이미지크기를 고정크기로 줘서 움직이게 하면됨

        이미지 크기 조절 방법2
        이미지 하나마다 div태그로 컨테이너를 줘서 width100%로 이미지를 div태그 컨테이너 안에
        꽉채우고 이미지를 채우는 방식이 반응형이나 모바일웹에도 유리함

 

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>Document</title>
    <!-- font awesome : 아이콘  -->

<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="header">
            <div class="userMenu">
                <ul>
                    <li><a href="#">회원가입</a></li>
                    <li><a href="#">로그인</a></li>
                    <li><a href="#">고객센터</a></li>
                </ul>                
            </div>
            // h1은 보통 로고를 넣을 때 사용 
            <h1><img src="" alt="logo"></h1>
            <div class="menuBox">
                <div></div>
                <ul>
                    <li></li>
                    <li></li>
                    <li></li>
                    <li></li>
                    <li></li>
                </ul>
            </div>
        </div> -->

        <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

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