My Current Project
Currently, I am in the process of developing a picture framing calculator using a combination of HTML, CSS, and JavaScript.
Functionality of the Calculator
For this calculator, users will input values such as:
Frame Width (wf): 16
Frame Height (hf): 20
Picture Width (wp): 11
Picture Height (hp): 17
Mat Overlap (o): .25
The equations utilized in the functionality are as follows:
Width
=(1 / 2) * (hf - hp + o)
=1.625
which corresponds to the<div id="width">
Height
=(1 / 2) * (wf - wp + o)
=2.625
which corresponds to the<div id="height">
The Styling Code
* {
margin: 0;
padding: 0;
font-family: 'Lato', sans-serif;
}
/* Additional CSS Code Here... */
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8>
<link rel="stylesheet" href="style.css">
<title>Framing Calculator</title>
<!-- HTML & JavaScript Code Here -->
Current Issue & Attempts
Although I have successfully displayed the Width
value in the rectangle, I am encountering difficulties with displaying the Height
value. This snippet of code is where the issue lies:
<center><div style="width:300px;height:400px;border:1px solid #000;"><center><div id="width"><div id="height"></div></center></div></center>
My Inquiry
- How can I properly showcase the
as illustrated in this image? In the image, the calculated value of<div id="height">
1.625
is correctly displayed in the<div id="width">
.