1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#wrap {
    width:90%;
    /* 960px */
    height:500px;
    margin: 0 auto;
    border:2px solid #000;
}
 
.container {
    width:93.75%
    height:492px;
    margin:0 auto;
    border:4px solid #000;
}
 
.container div{
    display:inline-block;
    height:100%;
}
 
.container div:first-child {
    width:33.333333333333333%;
    background:#e75d5d;
}
.container div:first-child + div {
    width:66.666666666666667%;
    background:#2dcc70;
}
 

스타일 부분 컨테이너의 자식 스타일을 기억하기

1
2
3
4
5
<div id="wrap">
    <div class="container">
        <div></div><div></div>
    </div>    
</div>


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<html>
<head>
<meta charset="UTF-8">
 
<meta name="viewport" content="width=device-with, initial-scale=1, 
minimum-scale=1, maximum-scale=1, user-scalable=no">
<style>
@media all and (min-width:320px) {
    body {
    background: #e65d5d;}
}
@media all and (min-width:768px) {
    body {
    background: #2dcc70;}
}
 
@media all and (min-width:960px) {
    body {
    background: #6fc0d1;}
}
 
</style>
<title>meta tag</title>
</head>
<body>
<img src="http://static.naver.net/sports/common/snb/ci_naver.gif">
</body>
</html>
 
 


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<%@ page language="java" contentType="text/html; charset=euc-kr"
    pageEncoding="euc-kr"%>
 
<%-- 선언문의 앞에는 !가 붙어야 한다.--%> 
<%!
public int sum() {
    int total=0;
    for(int i=1 ; i<=100 ; i++) {
        total+=i;
    }
    return total;
}
%>
<%
String str = "1부터 100까지의 합 " ;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
 
<%=str %>은<%=sum() %>입니다.<br>
<%=str %>에 3을 곱하면<%=sum()*3 %>입니다.<br>
<%=str %>을 100으로 나누면<%=sum()/1000. %>가 됩니다.<br>
 
</body>
</html>


+ Recent posts