[계산기 CSS Markup]output 창의 높이관련
324
投稿した質問数 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을 적용해 보는 것은 어떨까요?
counter01.html은 어디있을까요?
1
8
1
존재하지 않는 일기 url입력 시 alert이 두 번 떠요
0
24
1
useState 직접 구현 부분에서 질문이 있습니다.
1
29
1
학습을 하고 블로그에 정리를 해도 괜찮을까요?
1
31
1
교재(3쇄)와 강의 내용 문의
0
31
2
섹션2번 부분 강의 화면이 잘 못된것 같아서 문의합니다.
0
23
1
call stack 표현이 잘못표현된것이 아닌가요?
0
69
2
React 와 Virtual DOM 의 이야기 영상 실행이 안됩니다.
0
34
1
일반 강의와 차이점?
1
53
1
!= 연산자의 역할
0
35
1
중요하진 않지만 설명하신부분에서 안된부분..
1
37
1
강의 듣는 순서가 어떻게 되나요?
0
50
1
stopPropagation()에 대해서 질문 있습니다.
0
50
2
12.13) 하단 여백 스타일링 관련 질문 드립니다.
0
65
2
27강 Context내 RSC 사용 관련 문의
0
85
3
다 봤는데 완료가 안되네요
0
87
1
공부를 하면서 질문이 있습니다.
0
141
2
prettier 오류
0
137
1
ebook의 MDN참조링크 업데이트 부탁드립니다.
1
119
2
[계산기]소수점 이하 '0' 버튼 입력시 상단표시 관련
0
926
1
ebook 문의
1
405
1
삭제를 다 하고 싶은데요,,,
0
353
1
질문드립니다.
0
234
1
fontawesome kit를 사용하는 네모박스만 나오고아이콘은 나오지 않아요
0
1088
1

