Create basic calculator look
This commit is contained in:
parent
e9ccdd75a2
commit
a97d1e9891
2 changed files with 62 additions and 18 deletions
34
index.html
34
index.html
|
|
@ -11,24 +11,22 @@
|
||||||
<main>
|
<main>
|
||||||
<div class="calculator">
|
<div class="calculator">
|
||||||
<div class="screen"></div>
|
<div class="screen"></div>
|
||||||
<div class="buttons">
|
<button class="num">1</button>
|
||||||
<button class="num">1</button>
|
<button class="num">2</button>
|
||||||
<button class="num">2</button>
|
<button class="num">3</button>
|
||||||
<button class="num">3</button>
|
<button class="operator">+</button>
|
||||||
<button class="operator">+</button>
|
<button class="num">4</button>
|
||||||
<button class="num">4</button>
|
<button class="num">5</button>
|
||||||
<button class="num">5</button>
|
<button class="num">6</button>
|
||||||
<button class="num">6</button>
|
<button class="operator">-</button>
|
||||||
<button class="operator">-</button>
|
<button class="num">7</button>
|
||||||
<button class="num">7</button>
|
<button class="num">8</button>
|
||||||
<button class="num">8</button>
|
<button class="num">9</button>
|
||||||
<button class="num">9</button>
|
<button class="operator">*</button>
|
||||||
<button class="operator">*</button>
|
<button class="num">0</button>
|
||||||
<button class="num">0</button>
|
<button class="clear">C</button>
|
||||||
<button class="clear">C</button>
|
<button class="equal">=</button>
|
||||||
<button class="equal">=</button>
|
<button class="operator">/</button>
|
||||||
<button class="operator">/</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
<footer>
|
<footer>
|
||||||
|
|
|
||||||
46
style.css
46
style.css
|
|
@ -0,0 +1,46 @@
|
||||||
|
body {
|
||||||
|
text-align: center;
|
||||||
|
flex-direction: column;
|
||||||
|
min-height: 100vh;
|
||||||
|
margin: 0;
|
||||||
|
background-color: #111;
|
||||||
|
color: #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
header {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.calculator {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(4, 1fr);
|
||||||
|
grid-template-rows: auto;
|
||||||
|
grid-gap: 5px;
|
||||||
|
background: purple;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.screen {
|
||||||
|
grid-column: 1 / span 4;
|
||||||
|
height: 100px;
|
||||||
|
background: #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
height: 100px;
|
||||||
|
width: 100px;
|
||||||
|
font-size: 50px
|
||||||
|
}
|
||||||
|
|
||||||
|
footer {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue