[계산기 CSS Markup]output 창의 높이관련
339
작성한 질문수 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을 적용해 보는 것은 어떨까요?
Context API vs Zustand 그리고 Auth
0
17
2
순수 함수 / 순수 컴포넌트
0
14
1
css box-sizing 관련 질문
0
28
2
스니펫이 이상해요
0
26
2
Editor Component의 최적화 불가능 이슈
0
36
2
useCallback ⊂ useMemo
0
33
2
깃허브 저장소를 어디에 첨부하셨나요?
1
34
1
nestjs 강의는 없나요??
1
36
2
스타터 저장소
1
37
1
What is Rxjs
0
26
1
라이브러리 설치 질문
0
33
2
linter 질문
0
38
2
수업자료 링크 접속했는데 404에러 뜹니다 ㅠ
1
41
1
primitive에 onClick 이벤트가 안되는 경우
0
28
2
감정일기장 vercel 배포 후 새로 고침 시 404페이지가 뜨는 이유
0
40
2
다 봤는데 완료가 안되네요
0
103
1
공부를 하면서 질문이 있습니다.
0
159
2
prettier 오류
0
145
1
ebook의 MDN참조링크 업데이트 부탁드립니다.
1
141
2
[계산기]소수점 이하 '0' 버튼 입력시 상단표시 관련
0
969
1
ebook 문의
1
412
1
삭제를 다 하고 싶은데요,,,
0
367
1
질문드립니다.
0
247
1
fontawesome kit를 사용하는 네모박스만 나오고아이콘은 나오지 않아요
0
1107
1





