• 비디오

 

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Document</title>

</head>

<body>

    <h1>SUMMER BEACH</h1>

    <video width="400" height="220" controls autoplay>

        <source src="media/Beach.mp4" type="video/mp4">

        <source src="media/Beach.webm" type="video/webm">

    </video>

</body>

</html>

 


 

  • 오디오

 

 

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>멀티미디어 재생</title>

    <style>

        #con{

            width: 600px;

            margin: 0 auto;

            padding: 20px;

        }

    </style>

</head>

<body>

    <div id="con">

        <h1>오디오 재생하기</h1>

        <audio src="media/bgsound2.mp3" controls>

        </audio>

    </div>

</body>

</html>

 

 

 

'Learning > HTML&JavaScript' 카테고리의 다른 글

자바스크립트  (0) 2020.07.24
CSS3 선택자  (0) 2020.07.24
HTML5 시멘틱 태그  (0) 2020.07.24
CSS 레이아웃  (0) 2020.07.21
CSS와 박스 모델  (0) 2020.07.21
  • <header>: 머리말

  • <nav>: 네비게이션 링크

  • <section>: 주제별 콘텐츠 영역

  • <article>: 콘텐츠 내용

  • <aside>: 본문 이외의 내용

  • <iframe>: 외부 문서 삽입

  • <footer>: 제작 정보와 저작권 정보

  • <address>: 제작자 정보와 연락처 정보

 

 


 

<!doctype html>

<html lang="ko">

<head>

<meta charset="utf-8">

<title>요안도라</title>



<link href="css/style3.css" rel="stylesheet" type="text/css"><!--[if lt IE 9]>

<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>

<![endif]-->

</head>



<body>

    <div class="container">

    <header>

        <h1>Joandora</h1>

        <h2>가장 제주다운 수산리집</h2>

    </header>

    <nav class="navi">

        <ul>

            <li><a href="#">이용 안내</a></li>

            <li><a href="#">객실 소개</a></li>

            <li><a href="#">예약 방법</a></li>

            <li><a href="#">예약 하기</a></li>

        </ul>

    </nav>

    <section class="content">

        <h2>요안도라 소개</h2>    

        <h3>¤ 요안도라는 게스트 하우스(Guest House) 형식의 농어촌 민박입니다</h3>

        <p>성산의 날씨는 다음주 내내 높은 구름에 햇살 가득이라고 합니다. 목요일이면 섭씨 27도까지 오른다고 하지만, 늘 부는 바람이 쾌적한 균형을 잡아 마당에 마당에 나가 앉아 있는 시간이 많아질듯 합니다.</p>

        <p>오늘은 사진에 보이는 긴 돌담을 따라 들어오는 요안도레 올레 입구에 특곤색의 대문을 달았습니다.</p>

        <p>내일은 두달 여동안 밖거리에 만든 데스트 하우스에 연백색의 황토 페인트를 칠할 예정입니다.<br>

        그리고 이것저것 사소한 저이를 마치고 나면, 나이 드시고 젊고 한 미지의 새식구들을 설렘으로 만나고 함께하고, 도시의 바븐 생활로 소원해진 오래된 친구와의 우정을 이 제주에서 새롭게 열어나가기 위해 요안도라를 세상에 알리려고 합니다.</p>

        <img src="images/banner2.png" width="700" height="233" alt="요안도라">

    </section>

    <aside class="sidebar">

        <h3>¤ 알립니다</h3>

        <p>게스트하우스 예약은 전화 070-###-#### 로 직접 통화하시는게 가장 정확하고 빠릅니다.

        인터넷 전화이므로 시외 전화 요금이 부과되지 않습니다. </p>

        <img src="images/2.jpg" alt="">

        <img src="images/1.jpg" alt="">

        <img src="images/4.jpg" alt="">

    </aside>

    <footer>

        <address>

            <p>제주특별자치도 남제주군 성산읍 수산리 000 번지 요안도라 </p>

            <p>yoan##@naver.com</p>

        </address>

            <p> Copyright ⓒ. All rights reserved.</p>      

    </footer>

    </div>

</body>

</html>

 

@charset "utf-8";

body {
	font: 14px 맑은 고딕;
}
.container {
	position:absolute;
	width: 960px;
	margin : 0 auto;
	background-color:#fff;
	border:1px solid #E7E7E7
}
header {
	position:relative;
	height: 280px;
	background-image: url('../images/bg.png');
	background-repeat: no-repeat;
	background-position: left top;
}
header h1{
	position:absolute;
	right:20px;
	bottom:70px;
	font-size:3em;		
	color:#FFC;	
	text-shadow:1px 2px 2px #000;		
}
header h2{
	position:absolute;
	right:20px;
	bottom:30px;
	font-size:2em;
	color:#FF0;	
	text-shadow:0px 1px 1px #000;	
}
.navi{
	position:relative;
	background:#271717;
	margin-top:-15px;
	width:960px;
	height:60px;
}

.navi ul{
	list-style: none; 
	height:40px;
	padding-top:10px;
	padding-bottom:5px;
}
.navi ul li {
	display:inline;
	font-size:15px;
}
.navi a, .navi a:visited {
	padding: 10px 5px 5px 35px;
	display: inline;
	color:#fff;
	width: 150px; 
	text-decoration: none;

}
.navi a:hover, .navi a:active, .navi a:focus {
		text-shadow:0px 2px 2px #000;
		color:#FC0;
}

.sidebar {
	float: right;
	width: 200px;
	height:550px;
	background-color:#DFD;
	padding-top:20px;
	padding-left:10px;
	padding-right:10px;
}

.sidebar img {
	margin-bottom: 5px;
	border: 1px solid #ccc;
	opacity:0.5; 
	text-align:center;
}

.sidebar img:hover{
	border:1px solid #000;	
	opacity:1.0;
}
.content {
	background-color: #FFFFFF;	
	padding-top:5px;
	padding-left:10px;
	width: 720px;
	float: left;
}

footer {
	padding: 10px 0;
	background-color:#030;
	color:#fff;
	text-align:center;
	clear: both;
}

header, section, footer, aside, article, figure {
	display: block;
}

.banner {
	margin: 0 10px 15px 10px;
	padding:0;	
}

 

 


 

<!DOCTYPE html>
<html lang="ko">
<head>
	<meta charset="utf-8">
	<title>HTML5 레이아웃</title>
<style>
	h1{font-size: 2em;}
	h2{font-size: 1.5em;}
	h3{font-size: 1.0em;}
	p{
		line-height: 20px;
		font-size: 12px;
	}
	body{
		font-family: "맑은 고딕", "고딕", "굴림";
	}
	#con{
		width: 800px;
		margin: 0 auto;
	}
	header{
		width: 100%;
		height: 150px;
		background-color: #f46075;
		background-image: url(images/nav2.png);
		background-repeat: no-repeat;
		background-position: right center;
	}
	header nav{
		float: left;
		width: 70%;
		margin-top: 50px;
	}
	nav ul{
		list-style-type: none;
	}
	nav ul li{
		display: inline;
		float: left;
		font-weight: bold;
		margin: 10px;
	}
	nav ul li a{
		color: white;
		text-decoration: none;
	}
	a:hover{
		color: yellow;
	}
	section{
		float: left;
		width: 580px;
		padding: 5px;
	}
	section article{
		float: left;
		height: 250px;
		width: 220px;
		margin: 5px;
		padding: 15px;
		border: 1px dotted #ccc;
	}
	aside{
		float: right;
		width: 250px;
		height: auto;
		border: 1px solid darkgreen;
		text-align: center;
	}
	.at1, .at2, .at3, .at4{
		transition: 2s;
		-webkit-transition: 2s;
		-moz-transition: 2s;
		-o-transition: 2s;
		-ms-transition: 2s;
	}
	.at1:hover{
		background-color: #cf9;
		border:1px solid green;
	}
	.at2:hover{
		background-color: #a2d0ff;
		border:1px solid blue;
	}
	.at3:hover{
		background-color: #ebcbfe;
		border:1px solid purple;
	}
	.at4:hover{
		background-color: #fc3;
		border:1px solid red;
	}
	footer{
		clear: both;
		width: 800px;
		margin-bottom: 0;
		background-color: #333;
		color: white;
		text-align: center;
		height: 50px;
	}
</style>
</head>
<body>
	<header>
		<nav>
			<ul>
				<li><a href="#">애완견 종류</a></li>
				<li><a href="#">입양하기</a></li>
				<li><a href="#">건강돌보기</a></li>
				<li><a href="#">더불어살기</a></li>
			</ul>
		</nav>
	</header>
	<section>
		<div id="con"></div>
			<h2>강아지 용품 준비하기</h2>
			<article class="at1">
				<h3>강아지 집 </h3>
				<p>강아지가 편히 쉴 수 있는 포근한 집이 필요합니다. 강아지의 집은 강아지가 다 큰 후에도 계속 쓸 수 있는 집으로 구입하세요.집을 구입하실 때는 박음질이 잘 되어 있는지, 세탁이 간편한 제품인지 꼭 확인하시고 고르시는 것이 좋습니다.</p>
			</article>
			<article class="at2">
				<h3>강아지 먹이 </h3>
				<p>강아지의 먹이는 꼭 어린 강아지용으로 나와있는 사료를 선택하세요. 강아지들은 사람에 비해 성장속도가 8배정도 빠르답니다. 따라서 강아지에게는 성장속도에 맞는 사료를 급여하셔야 합니다. 사람이 먹는 음식을 먹게 되면 양념과 향신료에 입맛이 익숙해지고, 비만이 될 가능성이 매우 높아집니다. 강아지용 사료는 생후 12개월까지 급여하셔야 합니다.</p>
			</article>
			<article class="at3">
				<h3>밥그릇, 물병 </h3>
				<p>밥그릇은 쉽게 넘어지지 않도록 바닥이 넓은 것이 좋습니다.물병은 대롱이 달린 것으로 선택하세요. 밥그릇에 물을 주게 되면 입 주변에 털이 모두 젖기 때문에 비위생적이므로 대롱을 통해서 물을 먹을 수 있는 물병을 마련하시는 것이 좋습니다.</p>
			</article>
			<article class="at4">
				<h3>이름표, 목줄</h3> 
				<p>강아지를 잃어버릴 염려가 있으니 산책할 무렵이 되면 이름표를 꼭 목에 걸어주도록 하세요. 그리고 방울이 달린 목걸이를 하고자 하실 때는 신중하셔야 합니다. 움직일 때마다 방울이 딸랑 거리면 신경이 예민한 강아지들에게는 좋지 않은 영향을 끼칠 수 있기 때문입니다.</p>
			</article>
		</div>
	</section>
	<aside>
		<img src="images/1.png" alt="리트리버">
		<img src="images/2.png" alt="코카">
		<img src="images/3.png" alt="비글">
	</aside>
	<footer>
		<p>Copyright 2012 funnycon</p>
	</footer>
</body>
</html>

 

 

 


<!DOCTYPE html>

<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>애완견 돌보기</title>  

    <link rel="stylesheet" href="css/layout-result.css" type="text/css">

</head>

<body>

    <header>

        <nav>

            <ul>

                <li><a href="#">애완견 종류</a></li>

                <li><a href="#">입양하기</a></li>

                <li><a href="#">건강돌보기</a></li>

                <li><a href="#">더불어살기</a></li>

            </ul>

        </nav>

    </header>

    <article>

        <h2>애완견 종류</h2>

        <section>

            <h3>활달한 강아지</h3>

            <dl>

                <dt>요크셔 테리어</dt>

                <dd>생기있고 활달한 성질을 가지고 있으며 자신보다 몸집이 큰 개나 집에 들어온 침입자를 겁내는 일이 없어 좋은 번견이고 우리나라 최고의의 가정견으로 자리 잡고 있다.</dd>

                <dt>말티즈</dt>

                <dd>애정이 많고, 충실하며 활발한 성격을 소유하고있다. 이 종은 1급 가정견으로 요크셔테리어와 함께 우리나라 최고의 가정견으로 자리잡고 있다.</dd>

                <dt>포메 라이언</dt>

                <dd>활기차고 명랑한 개로 유명하고, 걷는 모습이 우아하다.충실하고 우호적인 성격이 가장 먼저 거론된다. </dd>

                <dt>골든 리트리버</dt>

                <dd>이 견종은 충성심이 강하고 성격이 활달하여 어린아이나 여성이 상대하기에 적합한 견종이다.참을성 또한 강하여 현재는실내에서도 많이 길러지고 있다.</dd>

            </dl>

        </section>

        <section>

            <h3>온순한강아지</h3>

            <dl>

                <dt>쉬즈</dt>

                <dd>얼굴에서 풍기는 모습처럼 온순, 쉽게 친숙해지고 우호적이며,어린아이나 여성들이 기르기에 적합한 견종이다.</dd>

                <dt>퍼그</dt>

                <dd>매우 사려가 깊고 사랑스러운 견종이며 그다지 손질이 필요하지 않고 식사량에 비해 많은 운동량이 필요하지 않다.</dd>

                <dt>래브라도 리트리버</dt>

                <dd>침착하고 영리하여 어린이들을 안심하고 맡길 수 있다. 사람을 즐겁게 해주려는 성질이 있다 공을 가지고 노는 것을 가장  좋아한다. 현재 맹인 안내견과 마약견으로 사용중이다. 온순한 강아지를 좋아하는 분에게는 적합한 견종이다.</dd>

            </dl>

        </section>

        <section>

            <h3>사납지만 복종적인 강아지</h3>

            <dl>

                <dt>미니어쳐핀셔</dt>

                <dd>경계심이 강하고 영리하며 작은 몸집에 비해 매우 용감하다. 주인에게 매우 복종적이며 작은 몸집에 보디가드 역할을 충실히 수행한다.</dd>

                <dt>푸들</dt>

                <dd>사납진 않으나, 상당히 복종적이며, 지능지수가 애완견종 중 가장 뛰어나다.</dd>

                <dt>폭스테리어</dt>

                <dd>가정에서 키우기에 적합한 품종이다.  보호본능이 강하고 정이 많다. 하지만 사냥을 하던 본능이 조금은 남아있어 사나운 면이 있다. 이종을 좋은 품종으로 기르기 위해서는 어릴 때부터 엄한 훈련이 필요하기도 하다.</dd>

            </dl>

        </section>

    </article>

    <aside>

        <h3>건강한 강아지는</h3>

        <ul>

            <li>코가 젖어있고 눈꼽이 없어야 합니다.</li>

            <li>털에 윤기가 있는 것을 골라야 합니다.</li>

            <li>입에서 고약한 냄새가 나면 병이 있다는 증거입니다.</li>

            <li>가장 활발하게 움직이는 녀석을 고르는게 좋습니다.</li>

            <li>강아지들 중에서 적당한 체구를 유지한 강아지가 좋습니다.</li>

        </ul>

    </aside>

    <footer>

        <p>Copyright 2012 funnycom</p>

    </footer>

</body>

</html>

body{
    font-family: "맑은 고딕", "고딕", "굴림";
}
header{
    width: 80%;
    margin-right: auto;
    margin-left: auto;
    background-color: #069;
    padding: 10px;
    text-align: center;
    overflow: hidden; /*크기보다 내용이 많은 경우 넘쳐나는 부분을 감춤*/
}
header nav{
    width: 60%;
    margin-left: auto;
    margin-right: auto;
}
nav ul{
    list-style-type: none;
}
nav ul li{
    display: inline;
    margin: 15px;
}
nav ul li a{
    color: white;
    text-decoration: none;
}
article{
    width: 80%;
    margin-right: auto;
    margin-left: auto;
    border: 5px solid #333;
    padding: 5px;
    overflow: hidden;
}
article section{
    width: 30%;
    height: 650px;
    float: left;
    margin: 5px;
    padding: 5px;
    border: 1px dotted #333;
}
section h3{
    background: url(../images/bg-note.png) no-repeat left center;
    padding-left: 30px;
}
aside{
    clear: both;
    margin: 0 auto;
    width: 80%;
    height: auto;
    padding: 10px;
    background-color: #99cc33;

}
footer{
    clear: both;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
    padding: 10px;
    background-color: #333;
    color: white;
    text-align: center;
}

 

 

'Learning > HTML&JavaScript' 카테고리의 다른 글

CSS3 선택자  (0) 2020.07.24
HTML 멀티미디어  (0) 2020.07.24
CSS 레이아웃  (0) 2020.07.21
CSS와 박스 모델  (0) 2020.07.21
스타일과 스타일시트 글꼴  (0) 2020.07.17
  • CSS 포지셔닝: CSS를 웹 문서 요소를 적절히 배치하는 것

  • box-sizing: 박스 모델 너비 값의 기준을 정함

    • content-box: width 속성 값을 콘텐츠 영역 너비 값으로 사용

    • border-box: width 속성 값을 콘텐츠 영역에 테두리까지 포함한 박스 모델 전체 너비 값으로 사용

 

 

<!DOCTYPE html>



<html lang="ko">

<head>

  <meta charset="utf-8">

  <title>box-sizing</title>

  <style>

    .box1{

      box-sizing: content-box;

      width: 300px;

      height: 150px;

      margin: 10px;

      padding: 30px;

      border: 2px solid red;

    }

    .box2{

      box-sizing: border-box;

      width: 300px;

      height: 150px;

      margin: 10px;

      padding: 30px;

      border: 2px solid red;

    }

  </style>

</head>

<body>

  <div class="box1"> box-sizing = "content-box" </div>

  <div class="box2"> box-sizing = "border-box"</div>

</body>

</html>

 

 

 

 


 

 

  • float: 컨텐츠들을 띄어서 정렬

 

<!doctype html>

<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>박스모델</title>

    <style>

        .box1{

            padding: 20px;

            margin-right: 10px;

            background: yellow;

            float: left;

        }

        .box2{

            padding: 20px;

            margin-right: 10px;

            background: blue;

            float: left;

        }

        .box3{

            padding: 20px;

            margin-right: 10px;

            background: green;

            float: left;

        }

        .box4{

            padding: 20px;

            margin-right: 10px;

            background: pink;

            float: right;

        }

    </style>

</head>

<body>

    <div class="box1">박스1</div>

    <div class="box2">박스2</div>

    <div class="box3">박스3</div>

    <div class="box4">박스4</div>

</body>

</html>

 

 

 

 


 

  • clear: float 속성 해제

 

 

 

.box4{

            padding: 20px;

            margin-right: 10px;

            background: pink;

            clear: both;

        }

 

 

 

 


 

 

<!DOCTYPE html>



<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>2단 레이아웃</title>

    <style>

        div{

            border: 1px solid #ccc;

        }

        #container{

            width: 960px;

            padding: 20px;

            margin: 0 auto;

        }

        #header{

            padding: 20px;

            margin-bottom: 20px;

        }

        #content{

            width: 620px;

            padding: 20px;

            float: left;

            margin-bottom: 20px;

        }

        #aside{

            width: 220px;

            padding: 20px;

            float: right;

            background-color: #eee;

            margin-bottom: 20px;

        }

        #footer{

            padding: 20px;

            clear: both;

        }

    </style>

</head>

<body>

    <div id="container">

        <div id="header">

            <h1>사이트 제목</h1>

        </div>

        <div id="aside">

            <h2>사이드 바</h2>

            <p>모든 국민은 근로의 의무를 진다. 국가는 근로의 의무의 내용과 조건을 민주주의원칙에 따라 법률로 정한다.</p>

        </div>

        <div id="content">

            <h2>본문</h2>

            <p>재산권의 행사는 공공복리에 적합하도록 하여야 한다. 정부는 회계연도마다 예산안을 편성하여 회계연도 개시 90일전까지 국회에 제출하고, 국회는 회계연도 개시 30일전까지 이를 의결하여야 한다.

            <br><br>대통령의 임기가 만료되는 때에는 임기만료 70일 내지 40일전에 후임자를 선거한다. 제2항과 제3항의 처분에 대하여는 법원에 제소할 수 없다. 언론·출판에 대한 허가나 검열과 집회·결사에 대한 허가는 인정되지 아니한다.</p>

        </div>

        <div id="footer">

            <h2>푸터</h2>

            <p>이 헌법시행 당시의 법령과 조약은 이 헌법에 위배되지 아니하는 한 그 효력을 지속한다.</p>

        </div>

    </div>

</body>

</html>





 

 


 

 

  • CSS 포지셔닝

    • static: 문서의 흐름에 맞춤

    • relative: 첫번째 요소 기준 자연스럽게 배치

    • absoulte: 원하는 위치에 배치. 부모 요소 중 postion:relative인 요소로 위치.

    • fixed: 원하는 위치에 배치. 브라우저 창 기준

  • visibility

    • visible: 화면에 표시

    • hidden: 화면에 요소 감춤. 크기는 유지

    • collapse: 서로 겹치도록 조절

  • z-index: 요소 쌓는 순서 정함

 

<!doctype html>

<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>CSS 포지셔닝</title>

    <style>

        #wrap{

            position: relative;

            width: 300px;

            height: 300px;

            border: 1px solid gray;

        }

        .box{

            position: absolute;

            width: 50px;

            height: 50px;

            background: blue;

        }

        #crd1{

            top: 0; left:0;

        }

        #crd2{

            top: 0; right: 0;

        }

        #crd3{

            bottom: 0; right: 0;

        }

        #crd4{

            bottom: 0; left:0;

        }

        #crd5{

            top: 100px; left: 100px;

        }

    </style>

</head>

<body>

    <div id="wrap">

        <div class="box" id="crd1"></div>

        <div class="box" id="crd2"></div>

        <div class="box" id="crd3"></div>

        <div class="box" id="crd4"></div>

        <div class="box" id="crd5"></div>

    </div>

</body>

</html>

 

 

 

 


 

<!doctype html>

<html lang="ko">

    <head>

        <meta charset="utf-8">

        <title>visibility 속성</title>

        <style>

            img{

                margin: 10px;

                padding: 5px;

                border: 1px solid black;

            }

            .invisible{

                visibility: hidden;

            }

        </style>

    </head>

    <body>

            <img src="images/pic1.jpg">

            <img src="images/pic2.jpg" class="invisible">

            <img src="images/pic3.jpg">

    </body>

</html>

 

 

 


 

<!doctype html>

<html lang="ko">

    <head>

        <meta charset="utf-8">

        <title>z-index 속성</title>

        <style>

            div#wrapper {

                position: relative;

            }

            .box {

                position:absolute;

                width:100px;

                height:100px;

                border:1px solid black;

                font-size:26px;

            }

            #b1 {               

                left:50px;

                top:50px;

                background:#ff0000; 

                z-index: 1; 

            }

            #b2 {               

                left:110px;

                top:70px;

                background:#ffd800;

                z-index: 3;

            }

            #b3 {

                left:70px;

                top:110px;

                background:#0094ff;     

                z-index: 1;

            }

        </style>

    </head>

    <body>

        <div id="wrapper">

            <div id="b1" class="box">1</div>

            <div id="b2" class="box">2</div>

            <div id="b3" class="box">3</div>

        </div>

    </body>

</html>

 

 

 


 

 

  • column-width: 단의 너비를 고정, 화면 분할. 다단 편집.

  • break-before, break-after: 특정 요소의 앞이나 뒤에 다단 위치  (인쇄)

 

 

<!DOCTYPE html>

<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>HTML5 레이아웃</title>

    <style>

        body{

            font-family: "맑은 고딕", "고딕", "굴림";

        }

        .multi{

            -webkit-column-count: 120px;

            -moz-column-count: 120px;

            column-count: 3;

            column-gap: 20px;

            column-rule: 2px dotted yellow;

        }

    </style>

</head>

<body>

    <header>

        <h2>건강에 좋은 식품 - Super Food</h2>

    </header>

    <div class="multi">

        <p><b>코코넛 오일 </b>: 남미 파나마에서는.</p>

        <p><b>블루베리 </b>: 블루베리는 .</p>

        <p><b>아몬드 </b>: 혈관질환에 </p>

    </div>

</body>

</html>

 

 

 


 

 

<!DOCTYPE html>

<html lang="ko">

    <head>

        <meta charset="utf-8">

        <title>HTML5 레이아웃</title>

    <style>

            body{

                font-family:"맑은 고딕", "고딕", "굴림";

            }

            section {                           

                padding:20px;

                width:600px;

                margin:20px auto;

                border:1px solid #ccc;

                border-radius:10px;

            }

            .multi {

                -webkit-column-count: 3;

                -moz-column-count: 3;

                column-count: 3;

                -webkit-column-rule: 2px dotted #000;

                -moz-column-rule: 2px dotted #000;

                column-rule: 2px dotted #000;

                text-align: justify;

            }

            

            .no-col{

                background:#f0f0f0;

                margin:10px 3px;

                padding:20px;

                border-radius:5px;

                column-span: all;

    

            }

        </style>

    </head>

    <body>

        <section>

            <h2>건강에 좋은 식품 - Super Food</h2>

            <div class="multi">

                <h3>코코넛 오일</h3>

                <p>남 정도이다.</p>            

                <h3>아보카도</h3>

                <p>나무에서</p>

                <h3>케일</h3>

                <p>케일은</p>

                <h3>블루베리</h3>

                <p>블루베리는</p>

                <div class="no-col">

                    <h3>아몬드</h3>

                    <p>혈관질환에 </p>

                </div>

            </div>

        </section>

    </body>

</html>

 

 

 

 


 

 

  • caption-side: 캡션은 기본으로 표 위쪽에 표시. 이 속성을 이용해 아래쪽에도 표시가능

  • border: 표의 바깥 테두리와 셀 테두리 모두 지정

  • border-collapse: 표 테두리와 셀 테두리를 합칠 것인지 설정

 

 

<!DOCTYPE html>

<html lang="ko">

    <head>

        <meta charset="utf-8">

        <title>표 스타일</title>

    <style>

        body{

            font-family: "맑은 고딕", "고딕", "굴림";

            font-size: 20px;

        }

        .table1{

            border: 1px solid black;

            border-collapse: collapse;

        }

        .table1 td{

            border: 1px dotted black;

            padding: 10px;

            text-align: center;

        }

    </style>

    </head>

    <body>      

        <table class="table1">

            <caption>프로축구 경기 일정</caption>

            <tr>

                <td>울산</td>

                <td>울산 vs 인천</td>

            </tr>       

            <tr>

                <td>부산</td>

                <td>부산 vs 대전</td>

            </tr>       

            <tr>

                <td>서울</td>

                <td>서울 vs 강원</td>

            </tr>       

        </table>

    </body>

</html>

 

 

 


 

 

 

<!DOCTYPE html>

<html lang="ko">

    <head>

        <meta charset="utf-8">

        <title>표 스타일</title>

        <style>

            body{

                font-family:"맑은 고딕", "고딕", "굴림";

            }

            .schedule{

                border-collapse: separate;

                margin: 20px;

            }

            td{

                border: 1px solid black;

                padding: 10px;

                text-align: center;

            }

            #tb2 td{

                empty-cells: hide;

            }

        </style>

    </head>

    <body>      

        <table class="schedule" id="tb1">

            <caption>프로축구 경기 일정</caption>

            <tr>

                <td>울산</td>

                <td>울산 vs 인천</td>

                <td>TV 중계</td>

            </tr>       

            <tr>

                <td>부산</td>

                <td>부산 vs 대전</td>

                <td></td>

            </tr>       

            <tr>

                <td>서울</td>

                <td>서울 vs 강원</td>

                <td></td>

            </tr>                   

        </table>



        <table class="schedule" id="tb2">

            <caption>프로축구 경기 일정</caption>

            <tr>

                <td>울산</td>

                <td>울산 vs 인천</td>

                <td>TV 중계</td>

            </tr>

            <tr>

                <td>부산</td>

                <td>부산 vs 대전</td>

                <td></td>

            </tr>

            <tr>

                <td>서울</td>

                <td>서울 vs 강원</td>

                <td></td>

            </tr>

        </table>

    </body>

</html>

 

 


 

 

 

 

 

'Learning > HTML&JavaScript' 카테고리의 다른 글

HTML 멀티미디어  (0) 2020.07.24
HTML5 시멘틱 태그  (0) 2020.07.24
CSS와 박스 모델  (0) 2020.07.21
스타일과 스타일시트 글꼴  (0) 2020.07.17
<datalist>가 있는 신청서 폼  (0) 2020.07.17
  • 블록 레벨 요소: 요소 혼자 한 줄을 차지함. <div>, <p>등

  • 인라인 레벨 요소: 줄을 차지하지 않는 요소. <img>, <strong>등

 

  • 박스 모델: 실체 콘텐츠 영역, 패딩, 박스 테두리, 마진 등의 요소로 구성

 

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Document</title>

    <style>

        .box1{

            background: crimson;

            width: 400px;

            height: 100px;

        }

        .box2{

            background: blue;

            width: 50%;

            height: 100px;

        }

        div{

            margin: 10px;

        }

    </style>

</head>

<body>

    <div class="box1"></div>

    <div class="box2"></div>

</body>

</html>

 

 


 

  • display 속성: 블록 레벨 요소를 인라인 레벨 요소로 바꾸거나 인라인 레벨 요소를 블록 레벨 요소로 바꿈

    • display:block : 해당 요소를 블록 레벨로 지정

    • display:inline: 블록 레벨 요소를 인라인 레벨로 지정

    • display:inline-block: 요소를 인라인 레벨로 배치하면서 내용에는 블록 레벨 속성을 지정

    • display:none: 해당 요소를 화면에 표시하지 않음. 화면에서 공간도 차지하지 않음

 

 

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Document</title>

    <style>

        #block img{

            display:block;

            margin: 10px;

        }

        nav ul{

            list-style: none;

        }

        nav ul li{

            display: inline;

            margin-right: 20px;

            border-top: 3px solid black;

            padding: 10px 15px;

        }

        nav ul li a{

            text-decoration: none;

            color: black;

            

        }

        nav ul li:hover{

            background-color: #dbdbdb;

        }

    </style>

</head>

<body>

    <div id="block">

    <img src="images/pic1.jpg">

    <img src="images/pic2.jpg">

    <img src="images/pic3.jpg">

    </div>

    <div id="inline">

        <img src="images/pic1.jpg">

        <img src="images/pic2.jpg">

        <img src="images/pic3.jpg">

    </div>



    <nav>

        <ul>

            <li><a href="#">애완견종류</a></li>

            <li><a href="#">입양하기</a></li>

            <li><a href="#">건강돌보기</a></li>

            <li><a href="#">더불어살기</a></li>

        </ul>

    </nav>

</body>

</html>

 

 

 


 

 

nav{

            width: 100%;

            height: 60%;

            background-color: #069;

        }

        nav ul{

            list-style: none;

        }

        nav ul li{

            display: inline-block;

            margin: 20px;

            /*border-top: 3px solid black;*/

            padding: 10px 15px;

        }

        nav ul li a{

            text-decoration: none;

            color: white;

        }







<nav>

        <ul>

            <li><a href="#">애완견종류</a></li>

            <li><a href="#">입양하기</a></li>

            <li><a href="#">건강돌보기</a></li>

            <li><a href="#">더불어살기</a></li>

        </ul>

    </nav>

 

 

 


  • border-style 속성: 기본값이 none. 화면에 테두리 표시안됨. 

    • hidden: 테두리 나타나지 않음

    • dashed: 직선으로 된 점선

    • dotted: 점선

    • double: 이중선

 

        p{

            padding: 10px;

            border: 3px dotted black;

        }

        h1{

            padding: 5px;

            border-bottom: 3px solid #ccc;

        }

 

<h1>박스 모델</h1>

    <p>

    박스 모델은 실제 콘텐츠 영역, 박스와 콘텐츠 영역 사이의 여백인 패딩(padding), 박스의 테두리(border), 그리고 여러 박스 모델 간의 여백인 마진(margin)등의 요소로 구성되어 있습니다.

    </p>

 


 

 

    

   div{

            width: 200px;

            height: 100px;

            border-width: 5px 10px 15px 20px;

            margin: 15px;

            display: inline-block;

        }

        .round{

            border: 2px solid red;

            border-radius: 20px;

        }

        #bg{

            background: url(images/pic1.jpg) no-repeat;

            background-size: cover;

        }

 

 

<div class="round"></div>
<div class="round" id="bg"></div>

 

 


 

 

'Learning > HTML&JavaScript' 카테고리의 다른 글

HTML5 시멘틱 태그  (0) 2020.07.24
CSS 레이아웃  (0) 2020.07.21
스타일과 스타일시트 글꼴  (0) 2020.07.17
<datalist>가 있는 신청서 폼  (0) 2020.07.17
폼 관련 태그들  (0) 2020.07.14
  • 스타일: HTML 문서의 글꼴이나 색상, 정렬, 각 요소들의 배치 방법 등 문서의 겉모습을 결정짓는 내용들

    • 선택자 { 스타일 속성: 속성 값}

    • 선택자: 테이블, 목차 등 스타일 규칙이 적용될 대상

    • 속성이 여러개라면 세미콜론(;)으로 구분

    • 주석: /*와 */ 사이

  • 스타일시트: 스타일을 관리하기 쉽도록 한 군데 모아놓은 것

 

 

  • 글꼴

 

<!DOCTYPE html>



<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>웹 폰트 사용하기</title>

    <style>

      @import url('https://fonts.googleapis.com/css2?family=Nanum+Gothic&display=swap');

      .ng-font{

        font-family: 'Nanum Gothic', 돋움, 굴림;

      }

      p{

        font-size: 30px;

      }

    </style>

</head>

<body>

  <p>브라우저 기본 글꼴 사용</p>

  <p class="ng-font">나눔고딕 웹 폰트 사용</p>

</body>

</html>

 

 

'Learning > HTML&JavaScript' 카테고리의 다른 글

CSS 레이아웃  (0) 2020.07.21
CSS와 박스 모델  (0) 2020.07.21
<datalist>가 있는 신청서 폼  (0) 2020.07.17
폼 관련 태그들  (0) 2020.07.14
이미지와 하이퍼링크  (0) 2020.07.14
  • <datalist>: 여러 데이터의 나열 중 하나를 선택

  • <datalist>에 id부여

  • <input type="text">에 list="datalist의 id" 부여

 

 

<!doctype html>

<html lang="ko">

  <head>

     <meta charset="utf-8">

         <title> 웹 폼</title>

     <style>

             body {

                background-color:#fff; 

             }

             form fieldset{

                margin-bottom:25px; 

             }

             form legend{

                font-size:15px;

                font-weight:600; 

             }

            .reg {

                font-size:14px;

                width:110px;

                color:#390;

                font-weight:bold;       

                float:left;

                text-align:right;

                margin-right:10px;

             }   

             form ul li{

                list-style:none; 

                margin: 15px 0; 

                font-size:14px; 

             }

     </style>

  </head>

  <body>

    <h1>여름방학 특강 신청</h1>

    <form>

        <fieldset>

            <legend>수강 신청인</legend>

            <ul>

                <li>

                    <label for="id" class="reg">학번</label>

                    <input type="text" id="id" autofocus>

                </li>

            </ul>

            <ul>

                <li>

                    <label for="name" class="reg">이름</label>

                    <input type="text" id="name">

                </li>

            </ul>

            <ul>

                <li>

                    <label for="major" class="reg">학과</label>

                    <select id="major">

                        <optgroup label="공과대학">

                            <option value="archi">건축공학과</option>

                            <option value="mechanic">기계공학과</option>

                            <option value="indust">산업공학과</option>

                            <option value="elec">전기전자공학과</option>

                            <option value="computer">컴퓨터공학과</option>

                            <option value="chemical">화학공학과</option>

                        </optgroup>

                        <optgroup label="인문대학">

                            <option value="history">사학과</option>

                            <option value="lang">어문학부</option>

                            <option value="philo">철학과</option>

                        </optgroup>

                    </select>

                </li>

        </fieldset>

        <fieldset>

            <legend>수강 과목을 선택하세요</legend>

            <ul>

                <li>

                    <label for="interest" class="reg">관심분야</label>

                    <input type="text" id="interest" list="choice">

                    <datalist id="choice">

                        <option value="grammar" label="문법"></option>

                        <option value="voca" label="어휘"></option>

                        <option value="listening" label="리스닝"></option>

                        <option value="news" label="뉴스청취"></option>

                    </datalist>

                </li>

            </ul>

        </fieldset>

    </form>

  </body>

</html>

 

 

 

 

  • <form>태그: 폼을 만드는 기본 태그. 

    • method: 사용자가 입력한 내용들을 서버 프로그램으로 어떻게 넘겨줄지 지정

      • get: 사용자가 입력한 내용이 그대로 표시

      • post: 입력 내용의 길이에 제한 X, 입력한 내용 표시 X

    • name: 폼의 이름 지정

    • action: 폼 내용들을 처리해줄 서버 상의 프로그램 지정

    • target: 현재 창이 아닌 다른 위치에 열도록 지정

 

<!DOCTYPE html>



<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>label 태그 사용</title>

        <style>

            ul {

                list-style:none;

            }

            li {

                margin:20px;

            }

        </style>

</head>

<body>

    <form>

        <h3>수강분야(다수 선택가능)</h3>

        <ul>

            <li><input type="checkbox" value="grm">문법</li>

            <li><input type="checkbox" value="wr">작문</li>

            <li><input type="checkbox" value="rd">독해</li>

        </ul>

        <h3>수강과목(1과목만 선택가능)</h3>

        <ul>

            <li><input type="radio" name="subject" value="eng">영어회화</li>

            <li><input type="radio" name="subject" value="chn">중국어회화</li>

            <li><input type="radio" name="subject" value="jap">일어회화</li>

        </ul>

    </form>

</body>

</html>


  • <fieldset>: 폼 요소를 그룹으로 묶는 태그

  • <legend>: 필드셋의 제목을 붙이는 태그

 

<!DOCTYPE html>



<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>filedset과 legend 태그</title>

        <style>

            ul {

                list-style:none;

            }

            li {

                margin:20px;

            }

            li label {

                width:80px;

                float:left;

            }

            fieldset {

                margin:15px;

            }

        </style>

</head>

<body>

    <form>

    <fieldset>

        <legend>개인정보</legend>

        <ul>

            <li>

                <label for="name">이름</label>

                <input type="text" id="name">

            </li>

            <li>

                <label for="mail">메일주소</label>

                <input type="text" id="mail">

            </li>

        </ul>

    </fieldset>

    <fieldset>

        <legend>로그인 정보</legend>

        <ul>

            <li>

                <label for="id">아이디</label>

                <input type="text" id="id">

            </li>

            <li>

                <label for="pw">비밀번호</label>

                <input type="text" id="pw">

            </li>

        </ul>

    </fieldset>

    </form>

</body>

</html>


  • <input> 태그: 입력하는 부분. 내용의 종류는 type속성을 통해 지정

    • hidden: 사용자에게 보이지 않고 서버로 넘겨짐

    • text: 텍스트필드

    • search: 검색 상자

    • email: 메일 주소 입력

    • password: 비밀번호 입력

    • tel: 전화번호 입력 필드

    • checkbox: 체크박스

    • submit: 서버 전송 버튼

    • image: submit 버튼 대신 사용할 이미지 삽입

    • reset: 리셋 버튼

    • button: 버튼

<!DOCTYPE html>



<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>filedset과 legend 태그</title>

        <style>

            ul {

                list-style:none;

            }

            li {

                margin:10px;

            }

            li label {

                width:120px;

                float:left;

                text-align: right;

                padding-right: 8px;

            }

            fieldset {

                margin:15px;

            }

            input{

                width:200px;

            }

            input[type="submit"]{ 

                text-align: center;

                width: 100%;

                height: 30px;

                margin-top: 15px;

            }

        </style>

</head>

<body>

    <form>

    <fieldset>

        <legend>로그인 정보</legend>

        <ul>

            <li> 

                <label for="id">아이디</label>

                <input type="text" id="id">

            </li>

            <li>

                <label for="pw1">비밀번호</label>

                <input type="password" id="pw1">

            </li>

            <li>

                <label for="pw2">비밀번호 확인</label>

                <input type="password" id="pw2">

            </li>

        </ul>

    </fieldset>

    <fieldset>

        <legend>개인정보</legend>

        <ul>

            <li>

                <label for="name">이름</label>

                <input type="text" id="name">

            </li>

            <li>

                <label for="mail">메일주소</label>

                <input type="email" id="mail">

            </li>

            <li>

                <label for="phone">연락처</label>

                <input type="tel" id="phone">

            </li>

            <li>

                <label for="homep">블로그/홈페이지</label>

                <input type="url" id="homep"> <!--정확한 홈페이지 주소를 입력받기 위함-->

            </li>

        </ul>

    </fieldset>

    <input type="submit" value="가입하기">

    </form>

</body>

</html>

 

 


<!doctype html>

<html lang="ko">

  <head>

        <meta charset="utf-8">

     <title> 웹 폼</title>

     <style>

     body {

        background-color:#fff; 

     }

     form fieldset{

        margin-bottom:25px; 

     }   

     form legend{

        font-size:15px;

        font-weight:600; 

     }

     form label.reg {

        font-size:14px;

        color:#390;

        font-weight:bold;

        width:110px;

        float:left;

        text-align:right;

        margin-right:10px;

     }

     form ul li{

        list-style:none; 

        margin: 15px 0; 

        font-size:14px; 

     }

     

     #member, #stuffs {

        width:50px; 

     }

     

     #pre {

        margin-left:15px;

     }

     </style>

  </head>

  <body>

    <form>

        <fieldset>

            <legend>신청 과목</legend>

            <p>이 달에 신청할 과목을 선택하세요(1과목만 가능)</p>

            <label><input type="radio" name="subject" value="spk">회화</label>

            <label><input type="radio" name="subject" value="grm">문법</label>

            <label><input type="radio" name="subject" value="wr">작문</label>

        </fieldset>

        <fieldset>

            <legend>메일링</legend>

            <p>메일로 받고 싶은 뉴스 주제를 선택하세요 (복수 선택 가능)</p>

            <label><input type="checkbox" name="mailing1" value="news">해외 단신</label>

            <label><input type="checkbox" name="mailing2" value="dialog">5분 회화</label>

            <label><input type="checkbox" name="mailing3" value="pops">모닝팝스</label>

        </fieldset>

    </form>

  </body>

</html>

 

 

 


 

<!doctype html>

<html lang="ko">

  <head>

     <meta charset="utf-8">

     <title> 웹 폼</title>

  </head>

  <body>

    <form>

      <fieldset>

        <legend>과 티셔츠 설문</legend>

        <p>올해 과 티(T)를 만들려고 합니다. 원하는 색상을 추천해주세요</p>

        <label>선호색상<input type="color" value="#00FF00"></label>

      </fieldset>

    </form>

  </body>

</html>

 

 

 


 

 

 

<!DOCTYPE html>



<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>date</title>

</head>

<body>

    <form>

        <fieldset>

            <legend><h3>조회기간 선택</h3></legend>

            <label>시작: <input type="date" id="start" value="2020-07-01"></label>

            <label>끝: <input type="date" id="end" value="2020-12-31"></label>

        </fieldset>

        <fieldset>

            <legend><h3>대관시간 선택(오늘)</h3></legend>

            <label>시작 시간 <input type="time" value="09:00" id="start"></label>

            <label>종료 시간 <input type="time" value="18:00" id="end"></label>

        </fieldset>

        <fieldset>

            <legend><h3>대관시간 선택(다른날짜)</h3></legend>

            <label>시작 시간<input type="datetime-local" value="2020-07-01T09:00"></label>

            <label>종료 시간<input type="datetime-local" value="2020-12-31T09:00"></label>

        </fieldset>

    </form>

</body>

</html>

 


 

 

  • input 타입 중 submit: 제출

  • input 타입 중 reset: 취소 (쓴 내용을 지움)

 

<!DOCTYPE html>



<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>전송 - 리셋 </title>

    <style>

        body {

            padding:20px;

        }

    </style>

</head>

<body>

    <form action="register.asp" method="post">

        <fieldset>

            <h3>메일링 리스트 등록</h3>

            <label> 메일 주소 <input type="email"></label>

            <input type="submit" value="제출">

            <input type="reset" value="다시입력">

        </fieldset>

    </form>

</body>

</html>

 

 


  • input 타입 중 image: 버튼 대신 이미지 삽입

 

<!DOCTYPE html>



<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>이미지 버튼 </title>

    <style>

        table {

            border:0;

        }

        td {

            padding:5px 10px;

            border:0;

            vertical-align: middle;

        }

    </style>

</head>

<body>

    <table>

        <tr>

            <td>

                <label>아이디 <input type="text" size="15"></label>

            </td>

            <td>

                <label>비밀번호 <input type="password" size="15"></label>

            </td>

            <td>

                <input type="image" id="button" src="images/login.jpg" alt="login">

            </td>

        </tr>

    </table>

</body>

</html>

 

 


  • button 타입 중 onclick 속성: 함수 연결

 

<!DOCTYPE html>

<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>폼 버튼 </title>

    <style>

        li{

            list-style: none;

            padding: 10px;

        }

    </style>

</head>

<body>

    <form>

        <ul>

            <li><input type="button" value="새 탭 열기" onclick="window.open()"></li>

            <li><input type="button" value="탭 닫기" onclick="window.close()"></li>

        </ul>

    </form>

</body>

</html>

 

 

 


 

<이미지와 하이퍼링크>

  • <img src>: 이미지 삽입 태그

  • width, height: 이미지 크기 조절

 

<!DOCTYPE html>

<html lang="ko">

<head>

  <meta charset="UTF-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <meta http-equiv="X-UA-Compatible" content="ie=edge">

  <title>이미지 삽입하기</title>

</head>

<body>

  <h1>이미지 크기 조절</h1>

  <img src="images/gugudan.jpg" alt="바빠 구구단">

  <img src="images/gugudan.jpg" width="250" height="250">

</body>

</html>

 

 

 


 

  • <figure><figcaption>: 이미지 설명

 

<!DOCTYPE html>

<html lang="ko">

<head>

  <meta charset="UTF-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <meta http-equiv="X-UA-Compatible" content="ie=edge">

  <title>이미지 삽입하기</title>

  <style>

    img {

      border:1px solid #ccc;    

    }

    figure {

      display:inline-block;

    }

  </style>

</head>

<body>

  <figure>

    <img src="images/prod.jpg" alt="모카 마타리">

    <figcaption>예맨 모카 마타리</figcaption>

  </figure>

</body>

</html>


 

  • <a>태그: 하이퍼링크. <a>태그의 속성들

    • href : 링크한 문서나 사이트의 주소 입력

    • target: 링크한 내용이 표시될 위치를 지정

    • download: 링크한 내용을 다운로드

 

  • target 속성들

    • _blank: 링크 내용이 새 창이나 새 탭에서 열림

 

<!DOCTYPE html>

<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>링크 만들기</title>

    <style>

        a{

            text-decoration: none;

            color:black;

        }

    </style>

    </head>

<body>

    <h1>텍스트 링크 만들기</h1>

    <a href="http://www.google.com" target="_blank">구글사이트 이동</a>

    <h1>이미지 링크 만들기</h1>

    <a href="http://www.google.com">

        <img src="images/google.jpg">

    </a>

</body>

</html>


 

  • 한 페이지 안에서 이동하기

  • <a href="#"> 이용. 이동하고자 하는 단락에 id를 부여하고 하이퍼링크 주소에는 id를 뜻하는 #을 앞에 붙여줌

 

<!DOCTYPE html>

<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>링크 만들기</title>

</head>

<body>

    <h1>앵커 만들기</h1>

    <p>웹 문서가 너무 길 경우 필요한 곳마다 문서 안에 이름을 붙여놓고 그 위치로 한번에 이동하는 링크를 만들 수 있는데, 이 기능을 앵커(anchor)라고 합니다. </p>

    <ul id="menu">

        <li><a href="#content1"> 메뉴 1</a></li>

        <li><a href="#content2"> 메뉴 2</a></li>

        <li><a href="#content3"> 메뉴 3</a></li>

    </ul>

    <h2 id="content1">내용1</h2>

        <p>웹 문서가 너무 길 경우 필요한 곳마다 문서 안에 이름을 붙여놓고 그 위치로 한번에 이동하는 링크를 만들 수 있는데, 이 기능을 앵커(anchor)라고 합니다. </p>

        <p>웹 문서가 너무 길 경우 필요한 곳마다 문서 안에 이름을 붙여놓고 그 위치로 한번에 이동하는 링크를 만들 수 있는데, 이 기능을 앵커(anchor)라고 합니다. </p>

        <p>웹 문서가 너무 길 경우 필요한 곳마다 문서 안에 이름을 붙여놓고 그 위치로 한번에 이동하는 링크를 만들 수 있는데, 이 기능을 앵커(anchor)라고 합니다. </p>

        <p><a href="#menu">[홈으로]</a></p>

    <h2 id="content2">내용2</h2>

        <p>웹 문서가 너무 길 경우 필요한 곳마다 문서 안에 이름을 붙여놓고 그 위치로 한번에 이동하는 링크를 만들 수 있는데, 이 기능을 앵커(anchor)라고 합니다. </p>

        <p>웹 문서가 너무 길 경우 필요한 곳마다 문서 안에 이름을 붙여놓고 그 위치로 한번에 이동하는 링크를 만들 수 있는데, 이 기능을 앵커(anchor)라고 합니다. </p>

        <p>웹 문서가 너무 길 경우 필요한 곳마다 문서 안에 이름을 붙여놓고 그 위치로 한번에 이동하는 링크를 만들 수 있는데, 이 기능을 앵커(anchor)라고 합니다. </p>

        <p><a href="#menu">[홈으로]</a></p>

    <h2 id="content3">내용3</h2>

        <p>웹 문서가 너무 길 경우 필요한 곳마다 문서 안에 이름을 붙여놓고 그 위치로 한번에 이동하는 링크를 만들 수 있는데, 이 기능을 앵커(anchor)라고 합니다. </p>

        <p>웹 문서가 너무 길 경우 필요한 곳마다 문서 안에 이름을 붙여놓고 그 위치로 한번에 이동하는 링크를 만들 수 있는데, 이 기능을 앵커(anchor)라고 합니다. </p>

        <p>웹 문서가 너무 길 경우 필요한 곳마다 문서 안에 이름을 붙여놓고 그 위치로 한번에 이동하는 링크를 만들 수 있는데, 이 기능을 앵커(anchor)라고 합니다. </p>

        <p><a href="#menu">[홈으로]</a></p>

</body>

</html>

 

 


 

  • <area>태그, usemap 속성: 한 이미지 상에 여러 다른 링크를 만드는 것

 

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>이미지맵</title>

    <style>

        a {

            text-decoration:none

        }

    </style>

</head>



<body>

    <img src="images/kids.jpg" alt="어린이이미지" usemap="#favorite">

    <map name="favorite">

        <area shape="rect" coords="10,10,160,200" href="http://www.daum.net" target="_blank" alt="다음페이지이동">

        <area shape="rect" coords="220,10,380,200" href="http://www.google.com" target="_blank" alt="구글페이지이동">

    </map>

</body>

</html>

 

 

 


 

  • svg 파일: 이미지를 확대하거나 축소하더라도 테두리가 원래의 깨끗한 상태로 유지되는 벡터 이미지

 

 

 

  • 표 제목: <caption>, <figure>, <figcaption>

 

<!DOCTYPE html>

<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>표 만들기</title>

    <style>

        table, th, td {

            border:1px solid #ccc;

        }       

        td, th {

            padding:10px;   /* 셀 테두리와 내용 사이의 간격(패딩) */

        }

    </style>

</head>

<body>  

    <table>

        <caption>

            <strong>Modern Browser</strong>

            <p>국내에서 자주 사용하는 모던 브라우저</p>

        </caption>

            <tr> 

                <th>브라우저</th>

                <th>제조업체</th>

                <th>다운로드</th>

            </tr>

            <tr> 

                <th>크롬(Chrome)</th>

                <td>Google</td>

                <td>https://www.google.com/chrome/</td>

            </tr>

            <tr> 

                <th>파이어폭스(Firefox)</th>

                <td>Mozilla</td>

                <td>https://mozilla.org/ko/firefox</td>

            </tr>

            <tr>

                <th>엣지(Edge)</th>

                <td>Microsoft</td>

                <td>https://www.microsoft.com/ko-kr/windows/microsoft-edge</td>

            </tr>

    </table>

</body>

</html>

 

 


<!DOCTYPE html>

<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>표 만들기</title>

    <style>

        table, th, td {

            border:1px solid #ccc;

        }       

        td, th {

            padding:10px;   /* 셀 테두리와 내용 사이의 간격(패딩) */

        }

    </style>

</head>

<body>  

    <figure>

        <figcaption>

            <p>국내에서 자주 사용하는 <b>모던브라우저</b></p>

        </figcaption>

    <table>

            <tr> 

                <th>브라우저</th>

                <th>제조업체</th>

                <th>다운로드</th>

            </tr>

            <tr> 

                <th>크롬(Chrome)</th>

                <td>Google</td>

                <td>https://www.google.com/chrome/</td>

            </tr>

            <tr> 

                <th>파이어폭스(Firefox)</th>

                <td>Mozilla</td>

                <td>https://mozilla.org/ko/firefox</td>

            </tr>

            <tr>

                <th>엣지(Edge)</th>

                <td>Microsoft</td>

                <td>https://www.microsoft.com/ko-kr/windows/microsoft-edge</td>

            </tr>

    </table>

    </figure>

</body>

</html>

 

 


 

  • 표 구조 정의하기: <thead>, <tbody>, <tfoot>

<!DOCTYPE html>

<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>표 만들기</title>

    <style>

        table, th, td {

            border:1px solid #ccc;

        }

        th, td {

            width:80px;  /* 셀의 너비 */

            padding:10px; /* 셀 테두리와 내용 사이의 간격(패딩) */

        }

        thead, tfoot { 

            background : #eeeeee;  /* thead와 tfoot의 배경 색 */

        }

    </style>

</head>

<body>

    <table>

        <caption>제주특별자치도 학교현황(2015.4.1 기준)</caption>

        <thead>

            <tr>        

                <th>구분</th>

                <th>학교수</th>

                <th>학급수</th>

                <th>학생수</th>

                <th>교원수</th>

            </tr>

        </thead>

        <tbody>

            <tr>

                <th>유치원</th>

                <td>117</td>

                <td>252</td>

                <td>5,547</td>

                <td>474</td>

            </tr>

            <tr>

                <th>초등학교</th>

                <td>111</td>

                <td>1,720</td>

                <td>37,686</td>

                <td>2,632</td>

            </tr>

            <tr>

                <th>중학교</th>

                <td>44</td>

                <td>699</td>

                <td>21,274</td>

                <td>1,412</td>

            </tr>

            <tr>

                <th>고등학교</th>

                <td>29</td>

                <td>676</td>

                <td>22,019</td>

                <td>1,433</td>

            </tr>

            <tr>

                <th>특수학교</th>

                <td>3</td>

                <td>90</td>

                <td>428</td>

                <td>160</td>

            </tr>

        </tbody>

        <tfoot>

            <tr>

                <th>합계</th>

                <td>300</td>

                <td>3,437</td>

                <td>86,954</td>

                <td>6,111</td>

            </tr>

        </tfoot>

    </table>

</body>

</html>

 

 


  • 열끼리 묶어 스타일 지정: <col>, <colgroup>

 

<!DOCTYPE html>

<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>표 만들기</title>

    <style>

        table, th, td {

            border:1px solid #ccc;

        }

        td {

            width:100px;  /* 셀 너비 */

            height:30px;  /* 셀 높이 */

        }

    </style>

</head>

<body>

    <table border="1">

        <caption>colgroup 연습</caption>

        <colgroup>

            <col>

            <col span="2" style="background-color: blue;">

            <col style="background-color: yellow;">

        </colgroup>

        <tr>

            <td></td>

            <td></td>

            <td></td>

            <td></td>

        </tr>

        <tr>

            <td></td>

            <td></td>

            <td></td>

            <td></td>

        </tr>

    </table>

</body>

</html>

 

 

 

 


 

 

  • 목록을 만드는 태그

    • <ul>, <li>: 순서 없는 목록. 각 항목 앞에 불릿이 붙여짐

    • <ol>,<li>: 순서 목록. 숫자 혹은 a,b,c로 구분

<!DOCTYPE html>

<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>1박 2일 가족 여행 코스</title>

</head>

<body>

    <ul>

        <li>1일차</li>

            <ol type="a">

                <li>해녀박물관</li>

                <li>낚시체험</li>

            </ol>

        <li>2일차</li>

        <ol type="a" start="3">

            <li>용눈이오름</li>

            <li>만장굴</li>

            <li>카약체험</li>

        </ol>

    </ul>

</body>

</html>

 


 

<!DOCTYPE html>

<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>1박 2일 가족 여행 코스</title>

</head>

<body>

    <h1>관광 안내 전화</h1>

    <p>한국관광공사에서는 전국의 관광안내소와 공동으로 여러분의 여행편의를 위해 관광안내전화 1330 서비스를 연중무휴 실시하고 있습니다.

    </p>

    <p>

    1330에는 해당 지역의 지도와 관광 가이드북, 관광안내소를 대신할 수 있을 정도의 다양한 정보가 있습니다. 원하는 관광지는 물론이며 숙박, 교통, 음식점 등의 자세한 정보를 한국어를 비롯한 영어, 중국어, 일어의 3개 국어로도 이용 가능합니다.

        <ul>

        <li>일반전화: (국번없이) 1330</li>

        <li>휴대전화: 064-1330</li>

        </ul>

    </p>

</body>

</html>

 

 

 


  • <dl>, <dt>, <dd>: 설명 목록

    • 제목과 그에 대한 설명으로 이루어진 목록

    • 하나의 <dt>에 여러 개의 <dd>값을 가질 수 있음

<dl>

<dt>

<dd>

<dd>

</dt>

</dl>

 

<!DOCTYPE html>

<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>제주 올레</title>

    <style>

        dl {

            line-height:25px;   /* 줄 간격 */

        }

    </style>

</head>

<body>

    <h1>제주 올레</h1>

    <dl>

        <dt>올레1코스</dt>

            <dd>코스: 시흥초등학교</dd>

            <dd>거리: 14.6km</dd>

            <dd>난이도: 중</dd>

        <dt>올레2코스</dt>

            <dd>코스: 광치기 해변</dd>

            <dd>거리: 14.5km</dd>

            <dd>난이도: 중</dd>

    </dl>

</body>

</html>

 


 

  • 표를 만드는 태그

    • <table>: 표 전체

    • <tr>: 행

    • <td>: 셀 <th>: 제목 셀

    • <colspan>, <rowspan>: 열과 행을 합침

<!DOCTYPE html>

<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>표 만들기</title>

    <style>

        table, th, td {

            border:1px solid #ccc;

        }       

        td {

            padding:5px;  /* 셀 테두리와 내용 사이의 간격(패딩) */

        }

    </style>

</head>

<body>

    <table>

        <tr>

            <th> 제목셀 </th>

            <td> 1행 2열 </td>

            <td> 1행 3열 </td>

        </tr>

        <tr>

            <th> 제목셀 </th>

            <td> 2행 2열 </td>

            <td> 2행 3열 </td>

        </tr>

    </table>

</body>

</html>

 

 

 

 


 

<!DOCTYPE html>

<html lang="ko">

<head>

    <meta charset="utf-8">

    <title>표 만들기</title>

    <style>

        table, th, td {

            border:1px solid #ccc;

        }       

        th {

            padding:15px;   /* 셀 테두리와 내용 사이의 간격(패딩) */

        }

        tr > td:nth-child(odd) { 

            width:120px;  /* 홀수번째 열의 너비 : 120px */

        }

        tr > td:nth-child(even) { 

            width:300px;  /* 짝수번째 열의 너비 : 120px */

        }

    </style>

</head>

<body>

    <table>

        <tr> 

            <th>이름</th>

            <td> </td>

            <th>연락처</th>

            <td> </td>

        </tr>

        <tr> 

            <th>주소</th>

            <td colspan="3"></td>

        </tr>

        <tr> 

            <th>자기소개</th>

            <td colspan="3"></td>

        </tr>

    </table>

</body>

</html>

 

 

+ Recent posts