[계산기 CSS Markup]output 창의 높이관련
358
投稿した質問数 58
안녕하세요.
output 창의 높이가
강사님 화면처럼 고정되지가 않고,
previous 와 current.textContent 값이 있으면 높이가 조금 높아졌다가, 값이 없으면 작아집니다.

계산기의 style.css 를 그대로 따라 했고요.
안되서 강의 파일을 그대로 복사했어도 동일합니다.
당췌 이유를 모르겠습니다. ㅡㅡ;
( 참고로 강의 파일에는 right 로 되어 있어서 botton 으로 수정해서 적용했습니다. )
body {
height: 100vh;
background: linear-gradient(to right, #00aaff, #0f4c81);
}
[index.html]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<script src="main.js" defer></script>
<title>계산기</title>
</head>
<body>
<div class="calculator-grid">
<div class="output">
<div class="previous-operand" data-previous-operand></div>
<div class="current-operand" data-current-operand></div>
</div>
<button class="span-two" data-all-clear>AC</button>
<button data-delete>DEL</button>
<button data-operation>÷</button>
<button data-number>1</button>
<button data-number>2</button>
<button data-number>3</button>
<button data-operation>×</button>
<button data-number>4</button>
<button data-number>5</button>
<button data-number>6</button>
<button data-operation>+</button>
<button data-number>7</button>
<button data-number>8</button>
<button data-number>9</button>
<button data-operation>-</button>
<button data-number>.</button>
<button data-number>0</button>
<button class="span-two" data-equals>=</button>
</div>
</body>
</html>
[style.css]
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
height: 100vh;
background: linear-gradient(to bottom, #00aaff, #0f4c81);
}
.calculator-grid {
display: grid;
justify-content: center;
align-content: center;
min-height: 100vh;
grid-template-columns: repeat(4, 100px);
grid-template-rows: minmax(120px, auto) repeat(5, 100px);
}
.calculator-grid > button {
cursor: pointer;
font-size: 2rem;
border: 1px solid #fff;
outline: none;
background-color: rgba(255, 255, 255, 0.75);
}
.calculator-grid > button:hover {
background-color: rgba(255, 255, 255, 0.9);
}
.span-two {
grid-column: span 2;
}
.output {
grid-column: 1/-1;
background-color: rgba(0, 0, 0, 0.75);
display: flex;
align-items: flex-end;
justify-content: space-around;
flex-direction: column;
padding: 10px;
word-wrap: break-word;
word-break: break-all;
}
.output .previous-operand {
color: rgba(255, 255, 255, 0.75);
font-size: 1.5rem;
}
.output .current-operand {
color: #fff;
font-size: 2.5rem;
}
回答 1
0
안녕하세요 :)
제가 지금 소스를 크롬, 사파리에서 확인 했을 때 고정이 되어서요.
브라우저마다 조금 차이가 있을 수 있는데요.
output에 그럼 height을 적용해 보는 것은 어떨까요?
10월 15일 삭제예정 강의 문의
0
30
1
강의제목에 10/15일 삭제라고 나와있는데,
0
46
1
스크립트 영상 미일치
0
73
3
감정일기장 다이어리 필터 적용할때 컨텍스트를 Home에서 가져오는 특별한 이유가 궁금합니다.
0
53
2
강의 설명 중에 헷갈리는 것이 있네요
0
49
1
수업자료 관련 문의
0
65
3
1강 동영상 재생 오류
1
66
2
Composition단계에서 `Layer`는 누가 만드는지
0
41
1
Strict Mode 예시 질문!
0
58
2
수업이 안보여요
0
62
1
저자 블로그에 있는 강의는 어떤 강의인가요?
1
62
1
[해결됨]윈도우즈 환경에서 타입 스크립트 파일이 실행이 안됩니다.
1
86
5
4강 카드뉴스 자동화 자료가 안보입니다!!
0
106
2
윈도우즈 환경에서 진행중입니다.
0
63
2
4강 카드뉴스 자동화 자료
6
124
1
다 봤는데 완료가 안되네요
0
118
1
공부를 하면서 질문이 있습니다.
0
176
2
prettier 오류
0
158
1
ebook의 MDN참조링크 업데이트 부탁드립니다.
1
155
2
[계산기]소수점 이하 '0' 버튼 입력시 상단표시 관련
0
985
1
ebook 문의
1
421
1
삭제를 다 하고 싶은데요,,,
0
384
1
질문드립니다.
0
261
1
fontawesome kit를 사용하는 네모박스만 나오고아이콘은 나오지 않아요
0
1117
1

