Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions function.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function myfunction() {
let celcius = (document.getElementById('value').value - 32) * 5/9;
document.getElementById('celciusformula').innerHTML = celcius;
}
38 changes: 38 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="en">
<link rel="stylesheet" href="style.css">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Temp Scale Converter</title>
</head>
<body>
<main>
<header>
<h1><strong>Temperature Scale Converter</strong></h1>
</header>

<section class="value">
<p>Value</p>
</section>

<section class="fahrenheit">
<h1>Fahrenheit</h1>
<input type="number" name="value" id="value" class="input" placeholder="Fahrenheit Number">
<button onclick="myfunction()" style=background-color:lightblue>Calculate</button>
</section>

<section class="celciusName">
<p><strong>Celsius</strong></p>
</section>

<section class="celcius">
<p id="celciusformula"></p>
</section>
</main>
<script src="function.js"></script>
</body>
</html>



42 changes: 42 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/* {
margin: 0;
padding: 0;
font-family: sans-serif;
}
*/
main {
width: 100%;
height: 100vh;
}
header {
display: flex;
justify-content: center;
padding-top: 30px;
}


.Fahrenheit{
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
margin: 10px;
}
.input {
margin: 0 100px;
border-radius: 5px;
padding: 5px;
border: solid;
}
body {
text-align: center;
border-style: solid;
margin: 50px;
}
.value {
text-align: center;
margin: 10px;
}
.celsius {
text-align: center;
}