반응형

2021-01-01

어제 선생님이 집에서 한번 짜보라고 이미지 파 일주 신 사진의 레이아웃을 잡아보았다. 

전체적인 크기를 눈대중으로 잡다보니 내가 만든 건 생각보다 사진보다 전체적으로 길이가 길었다. 

html 코드를 작성하고 거기다 css를 입히면서 계속 비슷하게 수정하다 보니 코드 전체가 복잡하고 지저분해 보이는데 이걸 체계적이라고 해야 되나 보기 좋게 코드를 작성하는 게 필요할 거 같은데 체계적으로 짜는? 그런 순서들이 있나 유튜브나 구글링을 통해 추가적으로 알아봐야겠다. 

사진과 비슷하게 계속 수정하면서 든생각은 웹 레이아웃을 잡을때 코드를 어떤 식으로 작성해도 모양만 잡으면 되는 건지 그 부분이 혼란스러웠던 거 같다. 되게 무식하게 일단 그림과 비슷하게 맞추자는 생각으로 수업시간에 배웠던 내용들을 뒤죽박죽 섞어가며 어찌어찌 모양은 만들어내서 보고 있자니 뿌듯은 한데 한편으로는 과연 이렇게 짜도 되는 것인가 싶다 흠.. 위치가 잡기 어렵다면 html 태그를 span으로 바꾸기도 하고 막 진짜 이거 넣고 안되면 다른 거 넣고 막 일단 될 때까지 이것저것 집어넣고 만들어서.. 흠 ㅋㅋ 컹스하다 컹컹스

html 코드

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>layout2</title>
    <link rel="stylesheet" href="2021-01-01.css";>
</head>
<body>
<header>
    <div id="logo">로고</div>

        <form id="search">
            <input type="text">
            <button>검색</button>
            <ul id="tool">
                <li>회원정보</li>
                <li>로그인</li>
                <li>회원가입</li>
            </ul>
        </form>


</header>
<nav>
    <ul>
        <li>프로젝트개요</li>
        <li>공지사항</li>
        <li>게시판</li>
        <li>자료실</li>
        <li>갤러리</li>
        <li>커뮤니티</li>
        <li>쇼핑몰</li>
        <li>관리자</li>
    </ul>
</nav>


<main>
    <aside>
        <ul id="menu">
            <li>회원가입</li>
            <li>아이디찾기</li>
            <li>비밀번호찾기</li>
        </ul>
        <ul id="option">
            <li>보안접속 ON |</li>
            <li><input type="checkbox">자동로그인</input></li>
        </ul>
        <table>
        <form id="login">
            <tr><td><input type="text"></td><td rowspan="2"><button>로그인</button></td></tr>
            <tr><td><input type="password"></td></tr>
        </form>
        </table>


        <p id="noti">공지사항</p>
        <ul class="notice">
            <li>아이유 사진도 좋아요</li>
            <li>수지 사진도 좋아요!</li>
            <li>아이유 사진도 좋아요</li>
            <li>수지 사진도 좋아요</li>
            <li>수지 사진도 좋아요</li>
        </ul>
        <div id="coment">광고문의 많이 주세요 ~~</div>
    </aside>

    <div class="container">
        <div id="main1">

        <h1>Hello, World!!</h1>
        <p>Maecenas ac orci risus. Proin id justo in justo egestas aliquam eget ac ipsum. In sed massa non urna consectetur dignissim. Morbi felis mi, mattis id dolor sed, maximus porta turpis. Mauris massa magna, tristique sed dui quis, fringilla malesuada urna. Integer egestas lobortis velit, ut ultrices tortor laoreet non. Phasellus ut orci blandit, molestie felis non, consequat lorem. Nulla facilisi. Ut imperdiet arcu tincidunt sem efficitur vehicula. Sed aliquet odio vel velit auctor sodales. Nunc lacinia est eget pharetra viverra. Etiam nec justo non diam semper ullamcorper. Aliquam a volutpat tellus, vel dapibus leo. Praesent efficitur aliquet magna nec interdum. Etiam lacinia risus sollicitudin, dictum sapien at, convallis mi. Ut dignissim pellentesque metus ut elementum.</p>
        </div>

        <section2>
        <div id="information">
            <span>최신정보</span>
            <ul>
                <li>[SKT/번이]&lt;갤럭시S3-할원:0원&gt;</li>
                <li>[KT 번이/기변] 갤그랜드[0]</li>
                <li>[SKT/번이]&lt;갤럭시S3-할원:0원&gt;</li>
                <li>[KT 번이/기변] 갤그랜드[0]</li>
                <li>[SKT/번이]&lt;갤럭시S3-할원:0원&gt;</li>
                <li>[KT 번이/기변] 갤그랜드[0]</li>
                <li>[SKT/번이]&lt;갤럭시S3-할원:0원&gt;</li>
                <li>[KT 번이/기변] 갤그랜드[0]</li>
                <li>[SKT/번이]&lt;갤럭시S3-할원:0원&gt;</li>
            </ul>
        </div>

        <div id="rivew">
            <span>사용기 /설치기</span>
            <ul>
                <li>엑스맨 감상기 [노스포]</li>
                <li>[Her] 감상기 - 개인평점 9/10</li>
                <li>아이패드 미니 1 간단한 사용기</li>
                <li>엑스맨 감상기 [노스포]</li>
                <li>[Her] 감상기 - 개인평점 9/10</li>
                <li>아이패드 미니 1 간단한 사용기</li>
                <li>엑스맨 감상기 [노스포]</li>
                <li>[Her] 감상기 - 개인평점 9/10</li>
                <li>아이패드 미니 1 간단한 사용기</li>
            </ul>
        </div>
        </section2>

        <div id="img">
            <span>이미지 갤러리</span>
            <ul id="img1">
                <li><div></div></li>
                <li><div></div></li>
                <li><div></div></li>
                <li><div></div></li>
                <li><div></div></li>
            </ul>
            <ul id="title1">
                <li>수지 환영</li>
                <li>수지 환영</li>
                <li>수지 환영</li>
                <li>수지 환영</li>
                <li>수지 환영</li>
            </ul>
            <ul id="img2">
                <li><div></div></li>
                <li><div></div></li>
                <li><div></div></li>
                <li><div></div></li>
                <li><div></div></li>
            </ul>
            <ul id="title2">
                <li>수지 환영</li>
                <li>수지 환영</li>
                <li>수지 환영</li>
                <li>수지 환영</li>
                <li>수지 환영</li>
            </ul>
        </div>
    </div>
</main>

<footer>
<span id="ft1">이용약관&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    개인정보보호방침&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    이메일무단수집거부&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    고객지원&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    권리침해신고&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;광고문의</span>
    <div id="lg">
    </div>
        <span id="ft2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Copyright(c) 2021. imlsw96 All Rights Reserved. Designed by HTML5, CSS<br>
        1 Infinite Loop, Cupertino, CA 95014. 개인정보 관리 책임자 : 스티브잡스 steve@apple.com</span>
</footer>
</body>
</html>
/*헤더*/
body {padding:0; margin:0;}
body {width:1250px; margin:50px auto;}
#logo {width:300px; height: 150px; background: silver; display: inline-block;}
#search {display: inline-block; width:950px; height:150px; background: yellowgreen; float:right;}
#search input {margin: 50px 0px 50px 55px; padding: 15px 200px; border: 5px solid darkgreen; }
#search button {padding:14px 30px; border: 5px solid darkgreen; font-weight: bold; color:white; background: darkgreen;
    border-right:5px solid black; border-bottom: 5px solid black; font-size:14px;}
#tool {float:right; list-style-type: none; padding-bottom: 10px; }
#tool li {float:left; padding-right:10px; font-weight: bold;}

nav {clear:both; background:black; height: 30px; padding-top:5px; }
nav ul {list-style-type: none; width:1250px;   margin:0 auto;}
nav li {color:white; float:left; padding-right:70px; font-size:20px; padding-left:20px;}


/*메인*/

/*사이드바*/
  main {min-height:1000px;}
aside {float :left; width:300px; background: yellow}
#menu {list-style-type: none;  margin-top: 50px;}
#menu li{float:left; padding-right:10px; padding-bottom:5px; font-size:14px;}
#option {clear:both; list-style-type:none; border-bottom: 3px solid gray; }
#option li {float:left; padding-top:5px; font-size:18px;}
table {margin:0 auto;}
table input {width:100px; padding:5px;}
table input[type='text'] {margin-bottom:7px;}
table button {margin-right:20px; padding:22px;}
#noti {clear-side:auto; background:black; color:white; font-size:18px; font-weight: bold; margin-top: 450px;}
.notice  { list-style-type: none;}
.notice li {font-weight: bold; padding-bottom: 6px;}
#coment {font-weight: bold;}


/*Hello World*/
.container {float:right; width:940px;  background: darkorange;}
#main1 {width:900px; height: 550px; background: mediumturquoise; margin:30px 20px 30px 20px; }
#main1 h1 {font-size: 75px;display: inline-block; margin-left: 25px; margin-top: 10px;}
#main1 p {font-size: 20px; font-weight: bold; width:600px; margin:0 0  50px 50px;
    padding-bottom:5px; }

/*최신정보   사용기/ 설치기*/
section2 {width: 900px; clear: both;}
#information{width: 420px; margin-left: 20px; float:left; background: white;}
#information ul{list-style-type: none;  }
#information span {text-align: left; background: mediumpurple; padding:10px 0 0px 0; width: 420px;
    display: inline-block; font-size:23px; font-weight: bold;}
#information li {padding-bottom:5px; font-size:18px; padding-bottom:10px;
    margin-right: 20px;}

#rivew {width:420px; float: right; background: white; margin-right:20px;}
#rivew span{text-align: left; background: greenyellow; padding:10px 0 0px 0; width: 420px;
    display: inline-block; font-size:23px; font-weight: bold;}
#rivew ul {list-style-type: none;}
#rivew li {padding-bottom:5px; font-size:18px; padding-bottom:10px;
    margin-right: 20px;}

/* 이미지갤러리 */
#img {clear: both;  width: 900px; height:450px;background: burlywood; margin-left:20px; margin-top:480px; margin-bottom: 50px;}
#img span {background:purple; display: inline-block; width: 900px; color: white; font-size: 23px;
    padding:10px 0 0 0;}
#img1 {list-style-type: none; list-style-position: inside;}
#img1 div { width: 135px; height: 135px; border: 1px dashed black;background: white; float: left; margin:10px 20px 10px 7px; display: inline-block;}
#title1 {clear:both; list-style-type: none; list-style-position: inside;}
#title1 li {float: left; width: 160px; font-size: 22px; border: 1px solid burlywood; text-align: center; }
#img2 {clear:both; list-style-position: inside; list-style-type:none;}
#img2 div { width: 135px; height: 135px; border: 1px dashed black;background: white; float: left; margin:10px 20px 10px 7px; display: inline-block;}
#title2 {clear:both; list-style-type: none; list-style-position: inside;}
#title2 li {float: left; width: 160px; font-size: 22px; border: 1px solid burlywood; text-align: center; }




/*footer*/
  footer {clear: both; width: 1250px; height: 200px; background: green}
#ft1 {background: blue; display: inline-block; width: 1250px; text-align: center; color: white; font-size: 22px;}
#lg {display: inline-block;  width: 300px; height: 170px; background: purple;}
#ft2 {display: inline-block;   margin:-60px 10px 0px 550px; padding-left: 50px;
    font-weight: bold; float:right;}


반응형

'JAVA &amp; APP :국비지원 학원 복습 > CSS' 카테고리의 다른 글

CSS : 웹레이아웃 짜기  (0) 2021.01.01
실습예제) CSS로 웹레이아웃 잡기  (0) 2020.12.30
CSS: 11 Table  (0) 2020.12.30
CSS : 10 list  (0) 2020.12.30
CSS : 09 Float  (0) 2020.12.30
반응형

HTML 코드

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>layout1</title>
    <link rel="stylesheet" href="2020-12-31.css";>
</head>


<body>
<div class="container">
    <header>
        <h1>logo</h1>
        <p><u>Log in</u> or <u>Create Account</u></p>
        <ul>
            <li>contact |</li>
            <li>store locactor |</li>
            <li> support |</li>
            <li> CART</li>
        </ul>
    </header>
    <nav>
        <input type="text">
        <select><option>Category</option></select>
        <button type="button">SEARCH</button>
    </nav>
    <div id="main">
        <section>
            <aside>
                <ul>
                    <li>All Categories</li>
                    <li>Category 1</li>
                    <li>Category 2</li>
                    <li>Category 3</li>
                    <li>Category 4</li>
                    <li>Category 5</li>
                    <li>Category 6</li>
                </ul>
            </aside>
            <div id="banner">
                <h3>[PROMOTIONAL IMAGES ROTATE HERE]</h3>
                <ul>
                    <li>1</li>
                    <li>2</li>
                    <li>3</li>
                    <li>4</li>
                </ul>
            </div>
        </section>
        <section>
            <div id="prodlist">
                <h3>Today's Specials</h3>
                <ul>
                    <li>
                        <div></div>
                        <p><a href="#">Product 1</a></p>
                    </li>
                    <li>
                        <div></div>
                        <p><a href="#">Product 2</a></p>
                    </li>
                    <li>
                        <div></div>
                        <p><a href="#">Product 3</a></p>
                    </li>
                    <li>
                        <div></div>
                        <p><a href="#">Product 4</a></p>
                    </li>
                    <li>
                        <div></div>
                        <p><a href="#">Product 5</a></p>
                    </li>
                    <li>
                        <div></div>
                        <p><a href="#">Product 6</a></p>
                    </li>

                </ul>
            </div>
        </section>
    </div>
    <footer>
        <ul>
            <li><h3>ABOUT US</h3></li>
            <li>Company</li>
            <li>News</li>
            <li>Jobs</li>
            <li>Policies</li>
            <li>Contact</li>
        </ul>
        <ul>
            <li ><h3>SOCIAL</h3></li>
            <li>Facebook</li>
            <li>Twitter</li>
            <li class="social">Try our app</li>
        </ul>
        <ul>
            <li ><h3>SERVICE</h3></li>
            <li>FAQ</li>
            <li>Live Support</li>
            <li class="social">Site map</li>
        </ul>
    </footer>
</div>

</body>
</html>

CSS 코드


body {padding:0; margin :0;}
/*헤더*/
.container {width:1150px; margin:15px auto; border: 3px solid black;}
.container  header {}
.container h1 {background:silver; width : 180px;  text-align: center; margin-left:20px;padding:20px; float:left;}
header {height: 125px;}
header p {float:left; margin-top:84px; padding-left:25px; text-decoration: none;}
header ul {float:right; margin-right:25px; list-style-type: none;}
header li {float:left; padding-right:5px;font-weight: bold;}
nav { background:silver; height:56px; }
nav input{ padding: 4px; margin-top:15px; margin-left:10px; width:350px;  border:3px solid gray;}
nav select{width:200px; padding: 3px; border:3px solid gray;}
nav button{width:120px; padding: 4px; margin-left:10px; background: dimgray; border-radius: 5px;}

/*메인*/
#main {min-height: 500px;  clear:both;}
#main aside{float:left;}
aside ul {list-style-type: none; border: 3px solid black; padding:0; margin:10px 10px 20px 20px; width:220px;
                }
aside li {border-bottom:2px solid silver; font-size:18px; font-weight: bold; padding:8px 14px;}
aside li:nth-of-type(7) {border-bottom: none;}
#banner {float: right; border:3px solid black; width:850px; height: 277px; margin:10px 30px 0px 5px;}
#banner h3 {  text-align: center; margin-top:87px; }
#banner ul {list-style-type: none; float:right; margin:30px 20px;}
#banner li {float: left; padding:8px 15px; background: #dcdcdc; margin-right: 10px; margin-top:40px;
                    font-weight: bold;}

#prodlist{clear:both;}
#prodlist h3 {margin-left:20px; margin-top: 50px;  }
#prodlist ul {list-style-type: none; margin-top: 50px; }
#prodlist li {float:left; padding-right:50px; margin-bottom: 160px; margin-right:15px; margin-left:20px;padding-bottom: -5px; }
#prodlist div{background: silver; border-radius: 5px; width: 100px; height: 100px;}
#prodlist a {text-decoration: underline; color:black;}
#prodlist p {text-align: center;}
#prodlist a:hover {text-decoration: underline; color:red;}


/*footer*/
footer {clear:both; border-top: 3px solid black; height: 250px; }
footer ul{list-style-type: none; display: inline-block;  padding-right:50px; margin-left:5px;}

 

 

 

세세한 부분까지 잡으려고 했는데 너무 늦어서 자야겠다 새벽 5시 새해를 컴퓨터 앞에만 있다가 맞이하는구나 ㅋㅋㅋㅋ

아무나 새해 복.. 

 

반응형

'JAVA &amp; APP :국비지원 학원 복습 > CSS' 카테고리의 다른 글

CSS : 웹레이아웃잡기 2 - layout1  (0) 2021.01.02
실습예제) CSS로 웹레이아웃 잡기  (0) 2020.12.30
CSS: 11 Table  (0) 2020.12.30
CSS : 10 list  (0) 2020.12.30
CSS : 09 Float  (0) 2020.12.30
반응형

2020-12-30 

 

따라하고자 할 표본 이미지

 


1. Home화면 구현

모든 화면의 기본 바탕을 해줄 Home 화면을 맨처음으로 구현후 구현해놓은 코드들을 가져와 main 값들을 채워 다른 페이지를 구현해보겠다.

 

<body>
<div class="container">
    <header><h1>JSP 프로젝트 v1</h1></header>
<nav>
    <ul id="nav">
        <li><a href="./teacherindex.html">Home</a></li>
        <li><a href="./signup.html">회원가입</a></li>
        <li><a href="./teacherlogin.html">로그인</a></li>
        <li><a href="./teacherlist.html">게시판</a></li>
        <li><a href="./teacherinfo.html">회원정보</a></li>
    </ul>
    <hr>
</nav>
        
    
<div id="main">
    <section>

        </table>
    </section>
 </div>

<footer>
    <hr>
    <p>copyright &copy; 2021. 2017. imlsw96. All Rights Reserved</p>
</footer>
   
</div>

html 적용 모습

        body{margin:0; padding:0;}
        .container { width: 1150px; margin: 0 auto;}
        nav ul{ list-style: none; padding:0 0 15px 0;}
        nav ul li {float: left; padding-left: 150px;}
        nav hr {clear:both; height: 1px; background: black;}
        
        #main {height: 500px;}
        
        footer hr {height:1px; background: black;}
        footer p {text-align: center;}
        
        /*링크에 대한 스타일 정의*/
        /*링크색 : 검정, 밑줄제거*/
        /*링크hover : 빨강, 밑줄표시*/
        #nav a {font-weight: bold;}
        #nav a:link {color:black; text-decoration: none;}
        #nav a:hover {color:red; text-decoration: underline;}
        #nav a:visited {color:black; text-decoration: none;}
        #nav a:active {color:red; text-decoration: none;}

css적용 모습


회원가입 구현

 

<body>
<div class="container">
    <header><h1>JSP 프로젝트 v1</h1></header>
    <nav>
        <ul id="nav">
            <li><a href="./teacherindex.html">Home</a></li>
            <li><a href="./signup.html.html">회원가입</a></li>
            <li><a href="./teacherlogin.html">로그인</a></li>
            <li><a href="./teacherlist.html">게시판</a></li>
            <li><a href="./teacherinfo.html">회원정보</a></li>
        </ul>
        <hr>
    </nav>


    <div id="main">
        <section>
            <h2>회원가입</h2>
            <table id="signup">
                <form method="post" name="signup">
                    <tr><th>아이디</th>
                        <td>
                            <label for="id"></label>
                            <input type="text" id="id" name="id">
                        </td></tr>
                    <tr><th>비밀번호</th>
                        <td>
                            <label for="pwd"></label>
                            <input type="password" id="pwd" name="pwd">
                        </td></tr>
                    <tr><th>비밀번호 확인</th>
                        <td>
                            <label for="pwdcheck"></label>
                            <input type="password" id="pwdcheck" name="pwdcheck">
                        </td></tr>
                    <tr><th>이름</th>
                        <td>
                            <label for="name"></label>
                            <input type="text" id="name" name="name">
                        </td></tr>

                    <tr><td></td><td id="bt2"><button id="button1">입력완료</button><button id="button2">다시입력</button></td></tr>

                </form>
            </table>
        </section>
    </div>

    <footer>
        <hr>
        <p>copyright &copy; 2021. 2017. imlsw96. All Rights Reserved</p>
    </footer>

</div>
</body>

   <style>
        #signup {margin:150px auto;}
        #signup th,td { padding-top:10px;}
        #signup th { text-align: right}
        #signup td { padding-left:10px;}
        #button1, #button2 {font-weight: bold; width: 65px; }
    </style>


로그인 화면 구현

<body>
<div class="container">
    <header><h1>JSP 프로젝트 v1</h1></header>
    <nav>
        <ul id="nav">
            <li><a href="./teacherindex.html">Home</a></li>
            <li><a href="./signup.html">회원가입</a></li>
            <li><a href="./teacherlogin.html">로그인</a></li>
            <li><a href="./teacherlist.html">게시판</a></li>
            <li><a href="./teacherinfo.html">회원정보</a></li>
        </ul>
        <hr>
    </nav>


    <div id="main">
        <section>
            <h2>로그인</h2>
            <table id="login">
                <form method="post" name="login">
                    <tr><th>아이디</th>
                        <td>
                            <label for="id"></label>
                            <input type="text" id="id" name="id">
                        </td></tr>
                    <tr><th>비밀번호</th>
                        <td>
                            <label for="pwd"></label>
                            <input type="password" id="pwd" name="pwd">
                        </td></tr>
                    <tr><td></td><td id="bt"><button id="button">로그인</button></td></tr>
                </form>
            </table>
        </section>
    </div>

    <footer>
        <hr>
        <p>copyright &copy; 2021. 2017. imlsw96. All Rights Reserved</p>
    </footer>

</div>
</body>
    <style>
        #login {margin:150px auto;}
        #login th,td { padding-top:10px;}
        #login th {text-align: right;}
        #login td { padding-left:10px;}
        #button {font-weight: bold; width: 65px; }

    </style>


회원정보 화면 구현

<body>
<div class="container">
    <header><h1>JSP 프로젝트 v1</h1></header>
    <nav>
        <ul id="nav">
            <li><a href="./teacherindex.html">Home</a></li>
            <li><a href="./signup.html">회원가입</a></li>
            <li><a href="./teacherlogin.html">로그인</a></li>
            <li><a href="./teacherlist.html">게시판</a></li>
            <li><a href="./teacherinfo.html">회원정보</a></li>
        </ul>
        <hr>
    </nav>


    <div id="main">
        <section>
            <h3>회원정보</h3>
            <table id="info" >
                <tbody>
                <tr><th ><b>아이디</b></th><td> imlsw96</td></tr>
                <tr><th><b>이름</b></th><td>이선우</td></tr>
                <tr><th><b>이메일</b></th><td>sunwoo866@naver.com</td></tr>
                <tr><th><b>가입일</b></th><td> 2020-12-23 15:35:00</td></tr>
                </tbody>
            </table>
        </section>
    </div>

    <footer>
        <hr>
        <p>copyright &copy; 2021. 2017. imlsw96. All Rights Reserved</p>
    </footer>

</div>
</body>
    <style>
        #info {margin:150px auto; }
        #info th{text-align: right;}
        #info td{padding-left: 15px;}
    </style>


게시판 화면 구현

<body>
<div class="container">
    <header><h1>JSP 프로젝트 v1</h1></header>
    <nav>
        <ul id="nav">
            <li><a href="./teacherindex.html">Home</a></li>
            <li><a href="./signup.html">회원가입</a></li>
            <li><a href="./teacherlogin.html">로그인</a></li>
            <li><a href="./teacherlist.html">게시판</a></li>
            <li><a href="./teacherinfo.html">회원정보</a></li>
        </ul>
        <hr>
    </nav>


    <div id="main">
        <section>
            <h2>게시판 본문글</h2>
            <table>
                <tr><th>제목</th><td>시간은 금이라구, 친구! 진짜라구, 친구! 정말이라구, 친구! 참말이라구, 친구!</td></tr>
                <tr><th>작성자</th><td>imlsw96</td></tr>
                <tr><th>작성일</th><td>2020-12-30 21:21:00(777)</td></tr>
                <tr><th id="text" >본문</th>
                    <td >
                        <div id="box">간다 간다 뿅간다 으아 나나나난 우아아아아아 러러러러러 시간은 금이라네
                        시간은 금이라네~ 은은 안된다네 동도 안된다네 ~ 오직 금이라네 오직 금이라네 금금금 월화수목
                        금금금 내일은 토요일 아니 목요일 금요일은 2021년 2020년 으아아아 나이를 한살더 한살더 잡숴봐
                        잡숴봐 맛나니까 잡숴봐 마이쮸를 잡숴봐 달달하니 잡숴봐 떡국을 잡솨봐 하얀 사골국물에 떡사리를 잔뜩
                        넣어봐 소고기를 찢어서 넣어봐 달걀지단을 만들어 넣어봐 지단의 박치기 지단의 박치기 박치기하면 박치기 공룡
                        박치기 공룡은 둘리엄마 둘리엄마 둘리둘리 내친구 아기공룡 공룡이 기가막혀 공룡이 기가막혀 사실은 강정 강정이
                        기가막혀 흥부가 기가막혀 흥부놀부 놀부보쌈 놀부부대찌개 놀부보쌈 보신분? 보쌈은 원할머니 보쌈 원할머니 보쌈은
                        비싸서 집에서 사다 드세요 아 머쉬베놈 두두등장 취리 췌키라웃 두두등장 보자보자 어데보자 보자봐자 어데보자
                            간다 간다 뿅간다 으아 나나나난 우아아아아아 러러러러러 시간은 금이라네
                            시간은 금이라네~ 은은 안된다네 동도 안된다네 ~ 오직 금이라네 오직 금이라네 금금금 월화수목
                            금금금 내일은 토요일 아니 목요일 금요일은 2021년 2020년 으아아아 나이를 한살더 한살더 잡숴봐
                            잡숴봐 맛나니까 잡숴봐 마이쮸를 잡숴봐 달달하니 잡숴봐 떡국을 잡솨봐 하얀 사골국물에 떡사리를 잔뜩
                            넣어봐 소고기를 찢어서 넣어봐 달걀지단을 만들어 넣어봐 지단의 박치기 지단의 박치기 박치기하면 박치기 공룡
                            박치기 공룡은 둘리엄마 둘리엄마 둘리둘리 내친구 아기공룡 공룡이 기가막혀 공룡이 기가막혀 사실은 강정 강정이
                            기가막혀 흥부가 기가막혀 흥부놀부 놀부보쌈 놀부부대찌개 놀부보쌈 보신분? 보쌈은 원할머니 보쌈 원할머니 보쌈은
                            비싸서 집에서 사다 드세요 아 머쉬베놈 두두등장 취리 췌키라웃 두두등장 보자보자 어데보자 보자봐자 어데보자</div>
                    </td></tr>
            </table>

        </section>
    </div>

    <footer>
        <hr>
        <p>copyright &copy; 2021. 2017. imlsw96. All Rights Reserved</p>
    </footer>

</div>
</body>
    <style>
        table {width: 750px; margin:70px auto;}
        table td{width: 480px; padding-left: 15px; text-align: left;}
        table th{text-align: right; width:150px;}
        #text {vertical-align: top;}
        #box{border: yellow; border-style: dotted; height:200px;overflow: hidden; }
    </style>

반응형

'JAVA &amp; APP :국비지원 학원 복습 > CSS' 카테고리의 다른 글

CSS : 웹레이아웃잡기 2 - layout1  (0) 2021.01.02
CSS : 웹레이아웃 짜기  (0) 2021.01.01
CSS: 11 Table  (0) 2020.12.30
CSS : 10 list  (0) 2020.12.30
CSS : 09 Float  (0) 2020.12.30
반응형

2020-12-30 수업 내용 정리 겸 복습

 

테이블:

데이터를 2차원 표형태로 나타내는데 사용하는 요소

 

border-collapse :

테이블의 테두리를 어떻게 표현할 것인지 정의

-seperate : 셀간 공백 유지 (기본값)

-collapse : 셀간 공백 제거

<h1>테이블 속성</h1>
<table class="table1">
    <tr><th>이름</th><th>국어</th><th>영어</th><th>수학</th></tr>
    <tr><td>이선우</td><td>100</td><td>100</td><td>100</td></tr>
    <tr><td>윤혜린</td><td>99</td><td>99</td><td>99</td></tr>
    <tr><td>권도연</td><td>98</td><td>98</td><td>98</td></tr>
</table>
        .table1 { border: 1px solid black;
            border-collapse: collapse}
        td, th{ border: 1px solid black; padding: 10px;}

border-sapcing :

border-collapse속성이 seperate일때

셀간 공백의 크기를 정의하는데 사용 가능하다.

 

table-layout :

테이블의 내용에 따라 테이블의 크기를 어떻게 표현할 것인지 정의

-fixed : 고정된 너비로 테이블의 크기를 고정함.

-auto : 내용에 따라 테이블이 자동으로 늘어남 ( 내용이 길어짐에 따라 열의 크기가 증가 )

 

<table class="table2">
    <tr><td>내용</td><td>123456789012345678901234567890</td></tr>
</table>
        .table2 {border: 1px solid blue;
            width: 300px;
            table-layout: fixed;}
        .table2 td{white-space:nowrap; overflow: hidden;text-overflow:ellipsis;
            text-align: center;}

테이블 가로크기 300px로 고정후 열값에 nowrap 문장을 넘기지 않겠다고 지정 overflow 넘치는거는 숨겨서 안보게 하겠다  text-overflow ellipsis숨겨진부분을 ...으로 표시하겠다.

+vertical-align :

테이블의 내용을 위, 아래, 가운데로 정렬하고 싶을때 사용

정렬방식은 top, middle, bottom으로 지정

<table class="table3">
    <tr>
        <td>1234567890</td><td>1234567890</td>
    </tr>
    <tr>
        <td>1234567890</td><td>1234567890</td>
    </tr>
     .table3 td { padding:0; width: 200px; height: 100px;}

        .table3 tr:first-child td:first-child { vertical-align: top;}
        .table3 tr:first-child td:nth-child(2) { vertical-align: bottom;}
        .table3 tr:nth-of-type(2) td:first-child {text-align:  center}
        .table3 tr:nth-of-type(2) td:nth-of-type(2) {text-align:  right;}

테이블의 padding값 0으로 줘서 기본적으로 왼쪽에 딱붙고 first-chile, nts-child(?), nts-of-type(?) 을이용해서 행과 열을 선택해서 vertical-align 과 text-align을 이용해서 정렬할 위치 선정

 

 

display : table

일반적으로 display 속성은 인라인 요소나 블록요소로 변환해서 출력하는데 사용하지만,

display 속성에 table을 지정하면 블록요소가 테이블의 성질을 가지게 할 수 있음

table : 요소를 테이블 요소처럼 보여줌

table-row : 요소를 테이블 tr 요소처럼 보여줌

table-cell : 요소를 테이블의 td요소처럼 보여줌

<div class="table4">
    <div class="tr">
        <div class="th">이름</div>
        <div class="th">국어</div>
        <div class="th">영어</div>
    </div>
    <div class="tr">
        <div class="td">수지</div>
        <div class="td">98</div>
        <div class="td">56</div>
    </div>
</div>
        .table4 { border: 1px solid blue; display: table; border-collapse: collapse;
            width: 300px; height: 100px; }
        .table4 .tr {display: table-row;}
        .table4 .th {display: table-cell; border: 1px solid black; font-weight: bold; text-align: center;
            vertical-align: middle;}
        .table4 .td {display: table-cell;border: 1px solid black; text-align: center; vertical-align: middle;}

반응형

'JAVA &amp; APP :국비지원 학원 복습 > CSS' 카테고리의 다른 글

CSS : 웹레이아웃 짜기  (0) 2021.01.01
실습예제) CSS로 웹레이아웃 잡기  (0) 2020.12.30
CSS : 10 list  (0) 2020.12.30
CSS : 09 Float  (0) 2020.12.30
CSS : 08 Position  (0) 2020.12.30
반응형

2020-12-30 수업 내용 정리 겸 복습

 

리스트 속성:

리스트 요소는 ul, ol, li 태그 등을 이용해서 

데이터 목록 형태로 표현할 때 사용함

특히, ul 요소를 이용해서 레이아웃의 gnb요소를 타나 내기도 함

( gnb : global navigation bar )

 

list-style-type:

목록 앞의 블릿기호나 숫자를 제어함

list-style-image:

글머리 기호나 숫자를 이미지로 대체함

만약, 이미지가 없는 경우 기본 글머리 기호가 보임

list-style-position:

글머리 기호나 숫자의 위치를 지정함 ( inside, outside )

단축 표기식 : 

list-style : 기호 모양 이미지

list-style : 기호모양 이미지;
<h1>리스트속성</h1>
<p>내가 좋아하는 게임 best5</p>
<ul class="games1">
    <li>피파</li>
    <li>리그오브레전드</li>
    <li>메이플스토리</li>
    <li>서든어택</li>
    <li>배틀그라운드</li>
</ul>
    .games1 { list-style-type: circle }

선택할수있는 종류가 엄청 많다.

<ul class="games2">
    <li>피파</li>
    <li>리그오브레전드</li>
    <li>메이플스토리</li>
    <li>서든어택</li>
    <li>배틀그라운드</li>
</ul>
        .games2 { list-style-type: circle; list-style-image: url(../img/llama.png);
                         list-style-position: inside}

gnb : global navigation bar 

어느 페이지에 있던지 간에 공통으로 보이는 메뉴바를 의미

보통 최상단 좌측에 위치하고 있음

<ul class="gnb">
    <li>다음메일앱</li>
    <li>공식블로그</li>
    <li>회원가입</li>
    <li>로그인</li>
</ul>
  .gnb { padding: 0; list-style: none; position: absolute; top: 25px; right:10px; }
        .gnb li{float: left; padding-left:5px;}
        
        

nb local navigation bar :

gnb를 클릭했을 때 나타나는 하위 메뉴 또는

특정 페이지에서만 볼 수 있는 부분 메뉴를 의미

 

snb sidebar navigation bar=lnb

주로 화면 좌측에 놓이는 서브메뉴를 의미

 

fnb footer navigation bar

footer에 놓이는 하위 메뉴를 의미

반응형

'JAVA &amp; APP :국비지원 학원 복습 > CSS' 카테고리의 다른 글

실습예제) CSS로 웹레이아웃 잡기  (0) 2020.12.30
CSS: 11 Table  (0) 2020.12.30
CSS : 09 Float  (0) 2020.12.30
CSS : 08 Position  (0) 2020.12.30
CSS : 07 TEXT  (0) 2020.12.29
반응형

2020-12-30 학원 내용 정리 겸 복습

 

float 속성 : 

웹 페이지 레이아웃 구성시 블록요소를 좌우로 배치하고 싶을때 사용하는 속성

물론, flexbox 레이아웃을 더 많이 사용하기도 하지만

flexbox 모델을 지원하지 않는 브라우져를 위해 여전히 사용되기도 함.

단, 설정된 float 속성을 해제하려면 clear 속성을 지정해줘야 함.

 

clear속성 :

설정된 float 속성을 해제할때 사용

left, right, both등의 값을 설정할 수 있음

 

<div class="container">
    <div class="box d1">1</div>
    <div class="box d2">2</div>
    <div class="box d3">3</div>
    <div class="box d4">4</div>
</div>
        .box {width: 100px; height: 100px; padding: 25px; font-size: 3em; color: black;}
        .d1{background: chartreuse; float: left;}
        .d2{background:cyan; float:left;}
        .d3{background:yellowgreen; float:right;}
        .d4{background:red; float:right;}
        .container {width: 960px; border: 1px solid orange; margin:100px auto 300px;}

  

실습예제)

웹페이지 틀을 float으로 짜보기

<div id="header">header</div>
<div id="container">
    <div id="aside">asid</div>
    <div id="main">main</div>
</div>
<div id="footer">footer</div>
  #header{width: 960px; height: 125px; background: gold;}
        #footer{width: 960px; height: 100px; background: red;}
        #container{width: 960px; height: 500px; overflow: hidden;}
        #aside{width: 180px;  background: rebeccapurple; height:500px; float:left;}
        #main{width:780px; height:500px; background: dodgerblue; float:right;}

+ 실습예제 )

위 그림을 세세하게는 말고 위의 예제처럼 틀 잡아보기

<div id="header">header</div>
<div id="navi">navi</div>

<div id="container">

    <div id="section">section1
        <div id="section2">section2</div></div>

    <div id="sidebar">sidebar</div>

</div>
<div id="footer">footer</div>
   #header {background: cadetblue; width:960px; height: 100px;}
        #navi {background: darkblue; width:960px; height: 100px; color:white; margin-top:20px}
        #footer {background: darkorange; width:960px; height: 100px; color:white; margin-top:20px}
        #container {width:960px; height:500px; overflow: hidden}
        #section {width:600px; height:500px; float:left; background: yellowgreen}
        #section2{width:600px; height:500px; float: left; background: yellow; margin-top:220px;}
        #sidebar{width:360px; height:500px; float: right; background: blueviolet}

얼추 모양은 맞췄는데 제대로된 방법으로 맞춘지는 잘모르겠다 내일 선생님 코드를 보고 수정할부분이 있으면

수정해야겠다.

반응형

'JAVA &amp; APP :국비지원 학원 복습 > CSS' 카테고리의 다른 글

CSS: 11 Table  (0) 2020.12.30
CSS : 10 list  (0) 2020.12.30
CSS : 08 Position  (0) 2020.12.30
CSS : 07 TEXT  (0) 2020.12.29
CSS : 06 Background  (0) 2020.12.29
반응형

2020-12-29 학원 내용 정리 겸 복습

 

position

대상요소의 위치를 정의함 

( top, bottom, left, right 속성과 함께 사용)

 

static :

기본 배치 방식

위에서 아래로(블록요소)

왼쪽에서 오른쪽으로 배치 (인라인 요소)

relative : 

상대 위치 배치 방식

static으로 선언된 요소를 기준으로 좌표 속성을 이용해서 배치

<h1>position속성</h1>
<div class="box static">static</div>
<div class="box relative">static</div>
 .box {width: 200px; height: 200px}
        .static { background: yellow; position: static;}
        .relative { background: green; position: relative;top: 50px; left: 100px;}

위의 설명대로 static노란박스를 기준으로 위로 50px 좌로 100px 떨어진것을 확인할 수 있다. 

 

+ 태그 속의 태그로 감싼다면 어떻게 될까 사진을 보면 알 수 있지만 부모 태그의 위치를 기준으로 위치를 조정해서 잡는 것을 확인할 수 있다.

<div class="box base">
    <div class="box relative2">relative2</div>
</div>
       .base {background: orange; margin-top: 100px;}
        .relative2{background: red;top: 50px; left: 100px; position: relative}
        /*        이전 요소의 위치를 기준으로 독립적인 요소로 변경이 되는 것을 확인 할 수 있고
        태그속의 태그를 보면 부모태그의 위치를 기준으로 위치를 잡는것을 확인 할 수 있다.*/

 

absolute:

절대좌표 배치 방식

브라우저 가시영역 (document 좌상단을 기준으로 좌표 속성을 이용해서 배치)

<div class="box absolute">absolute</div>
        .absolute { background: navy; color: white;
                            position: absolute; top: 100px; right: 100px;}

절대화면으로 위/오른쪽으로부터 100px 떨어지는것을 확인할 수 있다.

+ 태그 속의 태그가 absolute로 position을 잡았어도 부모태그의 위치로 절댓값이 설정되어서 위에서 보았던

   태그속의 태그 realtive와 동일하게 적용이 된다.

 

fixed : 

고정 좌표 배치 방식

브라우저 가시영역(document body)을 기준으로

배치되어 스크롤을 하더라도 언제나 그 위치에 고정배치

<div class="box2 fixed">장바구니</div>
  .fixed {position: fixed; top:50px; right:50px;}

상단/오른쪽 으로부터 50픽셀 떨어진 곳에 고정되는것을 확인
스크롤을 내려도 위의 사진과 동일한 위치에 존재하는것을 확인할 수 있다.

z-index :

z-index는 화면 전면에 출력되는 순서를 지정할 수 있음

z-index에 큰 값을 지정할수록 다른 요소들보다 위에 배치됨

<div class="normal">box1</div>
<div class="red absolutebox">box2</div>
<div class="green absolutebox">box3</div>
<div class="blue absolutebox">box4</div>
  .normal { width: 150px; height: 150px; background: yellow; z-index:30;}
        .absolutebox {width: 150px; height: 150px; position: relative;}
        .red { background: red; top:-50px; right: -50px; z-index: 50;}
        .green { background: green; top:-100px; right:-100px; z-index: 40;}
        .blue { background: blue; top: -150px; right:-150px; z-index:20;}

z-index 값이 높은순서대로 우선위를 갖는것을 확인할 수 있다.

 

overflow :

대상 요소의 영역을 벗어나는 요소에 대한 처리

필요에 따라 스크롤바를 표시하면 영역을 벗어나는 요소 모두 출력 가능

hidden, visible, scroll, auto

 

스크롤바를 세세하게 설정할 필요가 있는 경우

overflow-x, overflow-y를 사용해도 됨

 

.box3 { width: 150px; height:100px; border: 1px solid red;}
<div class="box3 overflow">차디찬 ~그라스에 빠아알가아아안 립스퉥~ 워우어웡우어 잘가세요~ 잘가세요 ~ 아아 ~~ 패건들지마 손모가지 날라가붕게 따라리따리리 따리라 쿵짝짝 쿵짝짝 따라리라리ㅣ논
    나는 이선우 나는이선우너는 누구냐 ~~ 아아아아~~ 어디보자 어디보자 넌 담에 보자</div>
<div class="box3 overflow2">
    <img src="../img/PS20110900045.jpg">
</div>
        .overflow {/*overflow: auto;*/
                            overflow-x: hidden; overflow-y: scroll;}
       .overflow2 { overflow: scroll;}

첫번째 텍스트 부분은 x축 스크롤을 숨기고 y축 스크롤만 생성되게 만들었고 자연스럽게 테두리를 초과하는 부분은 생략이 된다.   아래의 사진은 scroll하나만 넣어서 x/y축 스크롤이 생기는걸 확인할 수 있다.

 

반응형

'JAVA &amp; APP :국비지원 학원 복습 > CSS' 카테고리의 다른 글

CSS : 10 list  (0) 2020.12.30
CSS : 09 Float  (0) 2020.12.30
CSS : 07 TEXT  (0) 2020.12.29
CSS : 06 Background  (0) 2020.12.29
CSS : 05 Display  (0) 2020.12.28
반응형

2020-12-29 학원 내용 정리 겸 복습

 

font/text 속성

폰트 및 텍스트의 크기, 지정, 스타일, 정렬 등을 설정할 수 있음

 

font-size : 글자크기 설정

<h1>텍스트 속성</h1>
<p class="fontsize1">시간은 금이라구, 친구!</p>
<p class="fontsize2">시간은 금이라구, 친구!</p>
<p class="fontsize3">시간은 금이라구, 친구!</p>
     .fontsize1 { font-size: 14px;}  /*디폴트 값이 16px?*/
        .fontsize2 { font-size: 100%;}
        .fontsize3 { font-size: 1em;}

 

font family :

글자의 글꼴 설정

특정 글꼴이 미리 설치 되어야 보이는 경우도 있음 

단, 웹폰트를 사용하면 바로 보이기도 함

font-style : 글자의 모양

font-weight: 글자의 굵기 설정

<p class="fontfamily1">시간은 금이라구, 친구!</p>
<p class="fontstyle">시간은 금이라구, 친구!</p>
<p class="fontweight">시간은 금이라구, 친구!</p>

        .fontfamily1 {font-family: "궁서체";}
        .fontstyle { font-style: italic }
        .fontweight {font-weight:bolder}

 

font-variant : 글자의 대소문자 설정

 

 

line-height : 텍스트의 줄간격 설정

<p class="lineheight1">
    시간은 금이라구, 친구!<br>
    시간은 금이라구, 친구!<br>
    시간은 금이라구, 친구!<br>
    시간은 금이라구, 친구!<br>
</p>
<p class="lineheight2">
    시간은 금이라구, 친구!<br>
    시간은 금이라구, 친구!<br>
    시간은 금이라구, 친구!<br>
    시간은 금이라구, 친구!<br>
</p>
<p class="lineheight3">
    시간은 금이라구, 친구!<br>
    시간은 금이라구, 친구!<br>
    시간은 금이라구, 친구!<br>
    시간은 금이라구, 친구!<br>
</p>
        .lineheight1 {line-height:70%}
        .lineheight2 {line-height:1.2}    /* 16px * 1.2 */
        .lineheight3 {line-height:3.0}

letter-spacing : 글자간의 간격 설정

text-align : 텍스트의 수평 정렬 설정

text-decoration : 텍스트 꾸미기 설정

<p class="letterspacing1">시간은 금이라구, 친구</p>
<p class="letterspacing2">World of Warcraft</p>

<p class="center">시간은 금이라구, 친구</p>
<p class="right">시간은 금이라구, 친구</p>

<p class="overline">시간은 금이라구, 친구</p>
<p class="underline">시간은 금이라구, 친구</p>
<p class="linethrough">시간은 금이라구, 친구</p>
        .letterspacing1 {letter-spacing: 25px;}
        .letterspacing2 {letter-spacing: 35px;}

        .center {text-align: center;}
        .right {text-align: right;}

        .overline {text-decoration:  overline}
        .underline {text-decoration:  underline}
        .linethrough {text-decoration:  line-through}

 

text-overflow : 화면요소의 영역을 벗어나는 텍스트에 대한 처리

white-space : 
공백 space, 들여 쓰기 tab, 줄 바꿈 등을 의미하는 기호

html상에서는 이러한 기호들이 하나만 인식되거나 무시됨

white-space 속성을 이용하려면 이러한 기호를 제어할 수 있음

 nowrap : 모든 줄바꿈 무시

 pre : 공백, 들여쓰기, 줄 바꿈 모두 인식

<div class="box2 takeoverflow2">오오오 ~나느 머쉬베놈 멋이 베서 멋이베놈 어허어허 어데보자 어데보자~~ 너는 다메보자 ~ 다메다메요 이따이따요 ~ 이따이따요 ~ 장윤정의 탬버린 그건 현숙 탬버린 탬탬버린</div>
  .takeoverflow2 {margin-top: 100px; border:1px solid blue;
                  height: 25px; width: 300px;
                 white-space: nowrap; overflow: hidden;/*white-space : nowrap 줄바꿈을안하겠다 overflow: border 밖에 있는내용을 숨켜주겠다 히힛 ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ*/
                  text-overflow: ellipsis} /*elipsis ... 으로 무언가내용이 더있다는 것을 암시하겠다 히히히*/

word-wrap : 대상요소의 영역을 벗어나는 단어에 대한 처리

word-break : 대상요소의 영역을 벗어나는 단어에 대한 강제적 처리



<DIV class="box wordbreak">abcdefghijklmnopqrstuvwxxxxxyz http://123.123.456.789.123:8080/rookie/index.html</DIV>


      .wordbreak {word-break: break-word; margin-top: 100px;
            border:1px solid orange;}

 

글자 속성의 단축 표기식

font : 스타일 대소문자 여부 굵기 크기 줄 간격 글꼴

 

 

 

 

반응형

'JAVA &amp; APP :국비지원 학원 복습 > CSS' 카테고리의 다른 글

CSS : 09 Float  (0) 2020.12.30
CSS : 08 Position  (0) 2020.12.30
CSS : 06 Background  (0) 2020.12.29
CSS : 05 Display  (0) 2020.12.28
CSS : 04 BOX  (0) 2020.12.28
반응형

2020-12-29 수업내용 정리 및 복습

<body>
<h1>배경속성</h1>
<div id="box1" class="box"></div>
<div id="box2" class="box"></div>
<div id="box3" class="box"></div>
</body>

 

background :

해당 요소의 배경으로 이미지나 색상을 정의할 때 사용

 

background-color : 배경으로 색상 지정

.box{ width: 300px; height: 250px}
#box1{ background-color: orange;}

background-image : 배경으로 사진 지정

#box2{ background-image: url(../img/PS20110900045.jpg); }

   

background-repeat :

화면의 크기가 배경 이미지보다 크면 배경 이미지가 반복적으로 출력

반복 여부를 repeat-x, repeat-y, no-repeat으로 설정이 가능하다.

background-size :

배경이미지의 크기 설정

  body{background-image: url(../img/PS20110900045.jpg);
                   background-repeat: repeat;
                    background-size: 100px 100px;
                   }

 

 

background-position :

배경이미지의 위치 설정

설정 시 기준 위치는 top, left

미리 설정된 위치 값 (top, bottom, center, left, right)

 

background-attachment

스크롤 시 배경 이미지 고정여부 설정

       body{background-image: url(../img/PS20110900045.jpg);
            background-repeat: no-repeat;
            background-attachment: fixed;
            background-position: center;}

배경 속성 관련 단축 표기법

background : 색상 이미지 반복 여부 고정여부 위치 

 

background : 색상;

background : 이미지;

background : 이미지 반복여부 위치;

background : 이미지 반복여부 고정여부;

 

 

 
반응형

'JAVA &amp; APP :국비지원 학원 복습 > CSS' 카테고리의 다른 글

CSS : 08 Position  (0) 2020.12.30
CSS : 07 TEXT  (0) 2020.12.29
CSS : 05 Display  (0) 2020.12.28
CSS : 04 BOX  (0) 2020.12.28
CSS : 03 HTML과 CSS 연동하기  (0) 2020.12.28
반응형

Display:

display 속성은 레이아웃 정의에 자주 사용되는 중요한 속성이다.

 

block : 

대상 요소를 block처럼 보이게 한다.

요소가 너비가 내용에 상관없이 100%이므로

항상 새로운 라인에 배치

크기, 여백, 마진 지정 가능

div, h, p, ol/ul, li, hr, table, form

 

inline :

대상 요소를 inline처럼 보이게 함.

요소의 너비는 콘텐츠의 크기에 따라 결정

따라서, 새로운 라인에 배치되지 않고

라인 중간에 배치될 수도 있음

크기, 마진(좌/우만 허용) 지정 불가능

span, a, img, input, select, textarea

 

inline-block :

대상 요소를 inline과 block처럼 보이게 함.

새로운 라인에 배치되지 않지만

크기, 여백, 마진 지정 가능

 

가시성 :

visibility 속성은 대상요소를 보이게 할 것인지 말 것인지를 정의 

visible : 요소를 보이게 함

hidden : 요소를 보이지 않게함 (대신, 요소가 차지했던 영역은 남아있음)

none :  대상요소를 보이지 않게 할 때 display: none을 사용하기도 하지만 적용 방식이 다름

 

투명도 :

opactiy 속성은 대상의 투명도를 조절할 수있음

투명도 값은 0(투명) ~ 1(불투명) 사이임

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>display속성</title>
    <style>
        div:nth-of-type(1) {padding: 20px; background: orange;}
        div:nth-of-type(2) {background: aqua;padding:20px; width:300px}
        span { background : limegreen; width: 10px; height:10px; padding: 20px;}
        /*span은 상하 마진 적용불가 ! + 크기 적용불가!! */
        #inlineblock {background: darkorange; margin: 100px;
            width: 200px; height: 200px; display: inline-block;}
        #box1 { width:300px; height:300px; background: orange; visibility : hidden;}
        #box2 { width:300px; height:300px; background: orange; display: none;}
        #box3{width: 300px; height: 250px; background: orange; opacity: 0.55;}
        #box3:hover{opacity:1}
        img{opacity:0.55}
        img:hover{opacity: 1}
    </style>
</head>
<body>
<h1>display 속성</h1>

<div>
    <p>블록레벨 요소</p>
</div>

<div>
    <p>블록레벨 요소2</p>
</div>

<div>
    <p>시간은 <span>금이라구</span>, 친구 !</p>
    <span>Go Big or Go Extinct</span>
    <span>Hello, World!!</span>
</div>

<div>
    <span id="inlineblock">시간은 금이라구, 친구 !</span>
</div>
<hr>
<div id="box1">box1</div>
<div id="box2">box2</div>
<div id="box3">box3</div>
<hr>
<div id="box4"></div>
<img src="../img/free-icon-line-124027.png"; width="250">

</body>
</html>

두 번째 사진을 보면 box3 위에 빈 공간이 보이는데 이곳에 box 1,2를 써놨었다. 1은 hidden으로 보이지는 않지만

공간이 잡혀있는 걸 확인할 수 있고 box2 같은 경우 none으로 지정해 아예 공간도 차지 안 하고 있는 것을 확인할 수 있다.

반응형

'JAVA &amp; APP :국비지원 학원 복습 > CSS' 카테고리의 다른 글

CSS : 07 TEXT  (0) 2020.12.29
CSS : 06 Background  (0) 2020.12.29
CSS : 04 BOX  (0) 2020.12.28
CSS : 03 HTML과 CSS 연동하기  (0) 2020.12.28
CSS : 02 Unit  (0) 2020.12.28
반응형

2020-12-28 수업내용 정리 겸 복습

 

CSS 박스 모델

모든 HTML 요소는 박스 형태의 영역을 지니고 있음

이러한 박스는 기본적으로 내용, 안쪽 여백 바깥 여백 테두리등으로 구성

내용 content, 안쪽여백 padding, 바깥여백 margin, 테두리 border 등으로 구성

 

브라우저는 박스의 기본 크기와 속성, 위치를 기반으로 화면에 자리잡음

 

width/height 속성:

요소의 너비와 높이를 지정할 때 사용

단, 콘텐츠 영역보다 콘텐츠가 크면 영역을 넘쳐서 표시됨

사용 가능 단위는 px, %

 

margin/padding 속성:

콘텐츠를 둘러쌓고 있는 4개 방향( top/right/bottom/left )에 대해 지정가능

margin, padding은 1 갯값, 2 갯값, 3 갯값, 4 갯값을 이용해서 지정할 수 있음

한쪽면, -top, -right, -bottom, -left 속성을 이용해서

세부적으로 margin이나 padding을 조절할 수 있음.

 

자동 수평 정렬 :

margin의 left/right 속성을 auto라고 선언하면

해당 요소를 브라우저 중앙에 배치할 수 있음

 

테두리 : 

border-style, border-color, border-width 등의 속성을 가짐

padding/margin과 마찬가지로 단축 표기식으로 선언할 수 있음

border : 선두께 선종류 선색깔 형태로 정의해야 함

 

border-style : dotted, dashed, solid, doubled... 

border-width : thin, thick, medium, 수치 값,...

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>박스속성</title>
    <style>
        #box1 { width: 300px; background: yellow; padding: 25px; border: 5px solid navy; margin: 25px;}
        #box2 { width: 300px; background: yellow; padding: 25px; border: 5px solid navy; margin: 25px; height: 100px;
                        overflow: hidden;} /*overflow 넘치는부분을 hidden 숨겨버렸따뤼 ~*/
        #box3 { width: 300px; background: yellow; margin: 25px; border: 5px solid navy;
                    padding: 25px; /* 4개의 방향을 단일값으로 선언 */
                    padding : 25px 25px; /*2개의 방향(상하/좌우)을 단일값으로*/
                    padding : 25px 25px 25px; /*3개의 방향(상/좌우/하)을 단일값으로 선언*/
                    padding : 5px 10px 15px 25px; /*4개의 방향(상/우/하/좌)을 단일값으로 선언*/

                    padding-top: 5px;
                    padding-right: 20px;
                    padding-bottom: 45px;
                    padding-left: 65px;
        }
        #box4 { width: 300px; margin: 5px auto;}
        #box5 { width: 300px; border : 5px outset red;
                     border-top-style: dotted;
                     border-right-style: dashed;
                     border-left-style: double;
                     border-bottom-style: solid;
                     border-style: dotted dashed double solid;
                     /*점선-더긴점선-두줄 -굵음*/

                     border-top-color: yellow;
                     border-right-color: darkorange;
                     border-bottom-color: orchid;
                     border-left-color: darkred;
                     border-color: orange green navy lime;

                     border-width: thin thin thick thick;
                    }
    </style>
</head>
<body>
<h1>박스모델</h1>
<div id="box1">There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.</div>
<div id="box2">There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.</div>
<div id="box3">There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.</div>
<div id="box4">There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.</div>
<div id="box5">There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.</div>


</body>
</html>

 

반응형

'JAVA &amp; APP :국비지원 학원 복습 > CSS' 카테고리의 다른 글

CSS : 06 Background  (0) 2020.12.29
CSS : 05 Display  (0) 2020.12.28
CSS : 03 HTML과 CSS 연동하기  (0) 2020.12.28
CSS : 02 Unit  (0) 2020.12.28
CSS: 01 selector  (0) 2020.12.28
반응형

2020-12-28 수업내용 복습 겸 정리

 

HTML과 CSS 연동하기

HTML은 CSS를 포함하려면 

외부 스타일 방식, 내부 스타일 방식, 인라인 스타일 방식 중 골라서 사용할 수 있다.

 

외부 스타일 방식 :

<link rel="stylesheet" href="CSS파일 경로">

스타일시트 파일을 다운로드해서 적용하기 때문에 

빈번한 네트워크 사용량을 줄여 데이터 소모를 방지

 

일단 외부 스타일 시트를 생성해서 link 태그를 이용해서 html 코드안으로 가져온다.

p {color:red}
div {color:blue}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>CSS 연동방법</title>
    <link rel="stylesheet" href="03cssstyle.css">
</head>
<body>

<h1>CSS 연동방법</h1>
<P>으악 한발 두발 세발 네발 탕탕탕 해물탕</P>
<DIV>으아아아아아아아~~~~~~~개졸리다 개졸려</dIV>
</body>
</html>

내부 스타일 방식 :

head 태그에 style 태그를 정의하고 css 선언

html 내부에 css를 포함하는 방법

보통 테스트용/학습용으로 CSS를 작성한 후 

나중에 외부 스타일 방식으로 바꿈

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>CSS 연동방법</title>
    <style>
            p{ color: orange;}
            div{color: aqua;}
        </style>
</head>
<body>

<h1>CSS 연동방법</h1>
<P >으악 한발 두발 세발 네발 탕탕탕 해물탕</P>
<DIV >으아아아아아아아~~~~~~~개졸리다 개졸려</dIV>
</body>
</html>

인라인 스타일 방식 :

html 각 요소에 style이라는 속성을 이용해서 CSS 적용하는 방식

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>CSS 연동방법</title>
</head>
<body>

<h1>CSS 연동방법</h1>
<P style="color: green">으악 한발 두발 세발 네발 탕탕탕 해물탕</P>
<DIV style="background: darkorange" >으아아아아아아아~~~~~~~개졸리다 개졸려</dIV>
</body>
</html>

 

CSS 적용 우선순위

인라인 스타일 -> 내부 스타일 -> 외부스타일

단, 우선순위를 강제로 바꾸고 싶다면! important를 이용하면 됨.

 

반응형

'JAVA &amp; APP :국비지원 학원 복습 > CSS' 카테고리의 다른 글

CSS : 06 Background  (0) 2020.12.29
CSS : 05 Display  (0) 2020.12.28
CSS : 04 BOX  (0) 2020.12.28
CSS : 02 Unit  (0) 2020.12.28
CSS: 01 selector  (0) 2020.12.28
반응형

2020-12-28 수업내용 복습 겸 정리

 

크기 단위 :

CSS에서 사용하는 크기의 단위는 %, em, px 등이 있다.

 

% ( 백분율 단위) :

기본적으로 정해진 크기를 100으로 놓고 그에 대한 상대적 크기

요소에 기본적으로 지정된 사이즈나 상속된 사이즈 기준 )

 

px ( 픽셀 단위 ) :

스크린의 픽셀을 기준으로 정해진 절대적 크기, 해상도에 따라 상대적인 크기를 가짐

특정 요소의 크기가 x라 해도 해상도에 따라 더 크거나 더 작거나 다르게 보일 수 있다.

 

em : 

해당 폰트의 기본크기를 1로 놓고 그에 대한 상대적 크기

 

색상 표현하기 

 

색상 이름 : red, green, blue...

대부분의 브라우저에서는 140 색상이 정해져 있음

 

RGB 색상 :

rgb(빨강, 녹생, 파랑) , rgba(빨강, 녹색, 파랑, 투명도)

각 색상의 범위는 0~255까지 

rgb(빨강, 녹색, 파랑)

rgba(빨강, 녹색, 파랑, 투명도)

#빨강 녹색 파랑 (16진수 코드)

 

16진수

#빨강 녹색 파랑 각 색상의 범위는 0~FF로 정의

 

+ html web safe color로 검색하면 색상 차트를 볼 수 있음

<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="UTF-8">
    <title>CSS 단위</title>
    <link href="normalize.css">
    <style>
        body { text-align: center;
                    font-size: 14px;}
        #unitest1 {font-size: 14px;}
        #unitest2 {font-size: 100%;}
        #unitest3 {font-size: 120%;} /*14 x 120% =? 16.~**/
        /*font의 기본 사이즈는 16px
           상속받은 font사이즈는 14px */
        #unitest4 {font-size: 1em;}
        #unitest5 {font-size: 1.2em;}

        #box1, #box2, #box3 {width: 300px; height: 150px;}
        #box1 {background: rgb(255,0,0)}
        #box2 {background: rgba(255,30,2,0.5)}
        #box3 {background : #FF0000;}
    </style>
</head>
<body>

<h1>CSS 단위</h1>
<h2>크기 비교</H2>
<div id="unitest1">어떻게 보이나요?</div>
<hr>
<div id="unitest2">어떻게 보이나요?</div>
<div id="unitest3">어떻게 보이나요?</div>
<hr>
<div id="unitest4">어떻게 보이나요?</div>
<div id="unitest5">어떻게 보이나요?</div>
<hr>
<div id="box1"></div>
<div id="box2"></div>
<div id="box3"></div>
<p></p>

</body>
</html>

반응형

'JAVA &amp; APP :국비지원 학원 복습 > CSS' 카테고리의 다른 글

CSS : 06 Background  (0) 2020.12.29
CSS : 05 Display  (0) 2020.12.28
CSS : 04 BOX  (0) 2020.12.28
CSS : 03 HTML과 CSS 연동하기  (0) 2020.12.28
CSS: 01 selector  (0) 2020.12.28
반응형

2020-12-28 수업 내용 복습 겸 정리

 

 

CSS: Casscade style sheets

HTML요소들이 각종 미디어( pc, 태블릿, 핸드폰)에서 어떻게 보일 것인지를 정의

HTML4부터는 모든 서식 설정을 분리해서 따로 작성하게 됨

-> 웹 페이지의 스타일과 내용(HTML)을 분리시켜 스타일 설정/관리를 위해 작성하는 서식을 의미

 

CSS reset

각 브라우져마다 설정되어 있는 기본 스타일이 제각각

이러한 점을 개선하기 위해 CSS를 정의하기 전에

브라우저 기본 스타일 (여백, 간격)을 모두 초기화하는 것이 좋음.

 

eric meyer RESET CSS 2.0 (meyerweb.com/eric/tools/css)

Normalize (necolas.github.io/normalize.css)

위의 링크에 들어가서 다운받아서 적용하면 웹의 종류가 어떻든 웹의 스타일을 초기화해준다. 

 

 

선택자 selector

CSS를 적용할 요소를 가리키는 방법을 규정

요소/아이디/클래스/그룹/반응, 링크 , 상태/ 구조 선택자

 

요소 선택자 : 

지정한 태그에 대해 일괄적으로 스타일 적용

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        h2 {background:darkred}
        p {background:orange}
        div {background:aqua}

    </style>

</head>


<body>
<h2>하이루</h2>
<p>보이루</p>
<DIV>마법의 가루</DIV>

</body>
</html>

아이디 선택자 : 

특정 태그에 대해서만 스타일 적용

태그에 ID속성을 이용해서 이름을 선언하고

스타일 적용시 선택자 이름을 #으로 시작함

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #imlsw {background:green}
        #imlsw2 {background:darkorange}
        #imlsw3 {background:navy}

    </style>

</head>


<body>
<h2 id="imlsw">하이루</h2>
<p id="imlsw2">보이루</p>
<DIV id="imlsw3">마법의 가루</DIV>

</body>
</html>

클래스 선택자 :

서로 다른 여러태그들을 대상으로 일괄적으로 스타일 적용

태그에 class 속성을 이용해서 이름을 선언하고 스타일 저거 용시

선택자 이름을.으로 시작함

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
    .imlsw {background: darkorange}

    </style>

</head>


<body>
<h2 class="imlsw">하이루</h2>
<p class="imlsw">보이루</p>
<DIV class="imlsw">마법의 가루</DIV>

</body>
</html>

그룹 선택자 : 

서로 다른 여러 태그들을 대상으로 일괄적으로 스타일 적용

각 요소들을 ,를 이용해서 스타일을 적용할 대상을 선언함

경우에 따라 클래스 선택 자보다 편리하게 사용할 수 있음

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        h2,p,div {background: darkgreen}

    </style>

</head>


<body>
<h2 class="imlsw">하이루</h2>
<p class="imlsw">보이루</p>
<DIV class="imlsw">마법의 가루</DIV>

</body>
</html>

자손 선택자 : 

특정 요소의 하위 요소들을 대상으로 일괄적으로 스타일 적용

상위 요소와 하위 요소들을 공백으로 구분 지어 선언

상위 요소는 요소/아이디/클래스 선택자 중 하나가 될 수 있음.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div p{ background: aqua}
        div ul {background: darkred}
        div ul li {background: orchid}
    </style>

</head>


<body>
<div>
    <p>내가 좋아하는 분식</p>
    <ul>
        <li>탕수육</li>
        <li>족발 및 수육</li>
        <li>민초 떡볶이</li>
    </ul>

</div>

</body>
</html>

의사(pseudo 가짜) 클래스 선택자 :

해당 요소에는 실제로 존재하지 않지만 클래스가 선언된 것처럼 간주해서 만든 선택자

선언 방법은 '태그명:의사 클래스명' 형태이고,

상태, 반응, 링크 선택자 등에 지원됨

a 태그에 대한 의사 클래스 선택자 : link, :visited

반응 의사클래스 선택자 => :hover, :active, :focus

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        a:link {text-decoration: none; color:black;} /*링크색깔*/
        a:visited {color : black;} /*한번클릭하고나서 색깔변화*/
        a:active {color : green;} /*마우스 클릭하고 있는동안*/
        a:hover {color:red; text-decoration: underline;} /*마우스를 갖다대면*/
    </style>

</head>


<body>
<p>
    <a href="#">네이버로</a>
    <a href="#">다음으로</a>
    <a href="#">구글로 이동</a>
</p>

</body>
</html>

구조 의사 클래스 선택자 :

HTML 요소의 계층구주로를 기준으로 특정 위치에 있는 요소를 선택하고 싶을 때 사용

선언 방법은 '태그명:구조 의사 클래스명;' 형태임

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #food ul li:first-child { background: red; }
        #food ul li:last-child { background: blue; }
        #food ul li:nth-child(3) { background: orange; }
    </style>

</head>


<body>
<class id="food">
    <p>
    <ul>
        <li>탕수육</li>
        <li>족발 및 수육</li>
        <li>민초 떡볶이</li>
        <li>치킨</li>
        <li>햄버거</li>
    </ul>
    </p>
</class>

</body>
</html>

반응형

'JAVA &amp; APP :국비지원 학원 복습 > CSS' 카테고리의 다른 글

CSS : 06 Background  (0) 2020.12.29
CSS : 05 Display  (0) 2020.12.28
CSS : 04 BOX  (0) 2020.12.28
CSS : 03 HTML과 CSS 연동하기  (0) 2020.12.28
CSS : 02 Unit  (0) 2020.12.28

+ Recent posts