<form name="myForm" action="target.html" method="post" enctype="multipart/form-data">
파일선택: <input type="file" name="theFile"><br>
<input type="submit" value="전송">
<input type="reset" value="취소">
</form>
<form name="myForm" action="target.html" method="post">
<fieldset>
<legend>로그인</legend>
아이디: <input type="text" name="userid" value="inky4832"><br>
비밀번호: <input type="text" name="passwd"><br>
</fieldset>
</form>
공백
따옴표 "
엠퍼센드 &
문단표시 ¶
보다 작은 <
보다 큰 >
선택자 위주로 공부할 예정이다.
css 내에서의 주석
/* */
css 문법
selector(선택자) + Declaration(선언)
선언 : property(속성):value(값)
css의 적용방법 3가지
HTML 문서 내의 모든 태그를 선택할 때 사용한다.
태그{}
특정한 HTML 태그를 선택한다. 한꺼번에 여러 개 선택할 때 ,(쉼표) 사용
#아이디{}
.클래스{}
부모선택자 > 자식선택자 {}
부모선택자 자손선택자 {}
선택자 + 형제선택자
선택자 ~ 현재선택자
:nth-child(2n) : 자식 요소 중에서 n'th 를 선택. n을 가지고 다양한 방식으로 선택가능
<style>
p:nth-child(2n-1){
color: red;
}
</style>
테이블 짝수번째행 색깔 꾸미기 같은 곳에 사용할 수 있다.
폰트 사이즈의 기본값은 12pt, 16px, 1em, 100% 이다
pt 고정
em 가변 폰트 단위
RGB
16진법(HEX) 코드 단위
RGBA 값 ( alpha:투명도)
#one{
color: red;
}
#two{
color: #ff0000;
}
#three{
color: rgb(0,0,255);
}
#four{
color: rgba(0,0,255,0.3);
}
#five{
font-size: 32px;
}
#six{
font-size: 12pt;
}
none 화면에서 보이지 않게 만듭니다.
block
inline
inline-block
inline은 width와 height 설정이 불가능하다.
inline-block은 width와 height 설정이 가능하다.
visible
hidden
collapse
display 속성을 none 키워드로 지정하는 것과 달리 영역을 유지한 채로 보이지 않게만 만든다.
margin: 10px;
margin: 10px 10px 10px 10px; // 상 우 하 좌 (시계방향)
margin-top: 10px;
margin-right: 10px;
margin-bottom: 10px;
margin-left:10px;
margin: 10px 20px; // 상하 / 좌우
margin: 10px 20px 30px; // 상 좌우 하
margin: auto;
자동 중앙 정렬
border-style
border-width
border-color
border: width(굵기) style(스타일) color(색상)
border: thick dashed black;
width와 height값을 고정시키는 효과를 준다.
패딩이 바뀌면 콘텐트의 크기가 변경된다.
background-color :
background-image: url('../images/BackgroundFront.png');
background-image 속성 ( 중첩, CSS3 ) (이미지 여러개 쉼표로 나열가능)
background-repeat 속성
background-repeat: repeat;
기본적으로 이미지를 수평 및 수직 반복해서 전체화면에 꽉 차게 보여진다.
이때 수평 또는 수직으로 반복 처리 및 반복 처리하지 않는 경우에 사용 가
능한 속성이다.
background-attachment 속성
backgound-position 속성
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style>
.font-arial{
font-family: '기상천외한 폰트', sans-serif;
}
.font-roman{
font-family: '있는 폰트', serif;
}
.font-ansang{
font-family: '굵은안상수체', sans-serif;
}
</style>
</head>
<body>
</body>
<h1 class="font-arial">Lorem ipsum</h1>
<h1 class="font-roman">Lorem ipsum</h1>
<h1 class="font-ansang">Lorem ipsum</h1>
</html>
font-size
웹 브라우저의 기본 폰트 사이즈는 16px,12pt 이다.
xx-small ~ midium ~ xx-large
font-style : 폰트의 스타일, 글꼴
font-weight : 폰트의 두께 설정
lighter ~ normal ~ border
color
text-align
text-decoration
text-transform
text-indent
letter-spacing
line-height
word-spacing
justify: 양쪽정렬
h1{
text-decoration: overline;
}
h2{
text-decoration: line-through;
}
h3{
text-decoration: underline;
}
a{
text-decoration: none;
}
<style>
p.uppercase{
text-transform: uppercase;
}
p.lowercase{
text-transform: lowercase;
}
p.capitalize{
text-transform: capitalize;
}
</style>
첫문장 들여쓰기
text-indent: 50px;
글자 간격을 설정할 때 사용한다,
letter-spacing : 3px;
단어 간격을 설정할 때 사용한다.
word-spacing: 10px
line-height 속성
<style>
p.small{
line-height: 0.8;
}
p.big{
line-height: 1.8;
}
</style>
position 속성
다음은 부모 요소안에 자식요소를 absolute 속성을 이용하여 위치시키는 기본 방법이다.
가. 부모요소에 height 속성을 설정한다.
나. 부모요소에 relative position을 설정한다.
다. 자식요소에 absolute position을 설정한다.
z-index 속성 (Overlapping 요소 처리 )
z-index: -1;
overflow 속성
float 속성
float 속성에 사용 가능한 키워드값
left 해당 태그를 왼쪽에
right 해당 태그를 오른쪽에
clear:both 속성을 이용하여 특정 태그는 float 속성의 영향을 받지 않게 만들 수 있다.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
body{
margin: 10px;
}
/*
div 태그에 CSS 적용
*/
#all{
border: 1px solid blue;
width: 960px;
height: 900px;
overflow: hidden;
}
#top{
background-color: red;
width: 100%;
height: 20%;
border: 1px solid red;
}
#nav{
background-color: yellow;
width: 100%;
height: 5%;
text-align: right;
}
ul{
margin: 0px;
}
#nav li{
display: inline;
}
#left{
background-color: green;
float: left;
width: 20%;
height: 65%;
}
#center{
background-color: gray;
float: left;
width: 80%;
height: 65%;
}
#bottom{
background-color: yellow;
clear: both;
width: 100%;
height: 10%;
text-align: center;
}
</style>
</head>
<body>
<div id="all">
<div id="top">
</div>
<div id="nav">
<ul>
<li><a href="">로그인</a></li>
<li><a href="">회원가입</a></li>
<li><a href="">게시판</a></li>
</ul>
</div>
<div id="left">
<ul>
<li>Java</li>
<li>Java2</li>
<li>Java3</li>
<li>Java4</li>
</ul>
</div>
<div id="center">
</div>
<div id="bottom">
copyright ~~~~
</div>
</div>
</body>
</html>