Experiment 4
Experiment 4
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
body {
margin: 20px;
line-height: 1.6;
h1 {
text-align: center;
margin-bottom: 20px;
.container {
display: flex;
justify-content: center;
flex-wrap: wrap;
gap: 20px;
.box {
width: 200px;
position: relative;
text-align: center;
background-color: #f9f9f9;
.content {
padding: 20px;
background-color: #cce5ff;
color: #004085;
.interactive-inputs {
margin-top: 20px;
text-align: center;
label {
margin-right: 10px;
input {
width: 50px;
margin-left: 10px;
.preview {
margin-top: 20px;
text-align: center;
</style>
</head>
<body>
<div class="container">
</div>
<div class="interactive-inputs">
<label>
Margin:
</label>
<label>
Padding:
</label>
<label>
Border Width:
</label>
<label>
Border Color:
</label>
</div>
<div class="preview">
</div>
<script>
function updateBoxModel() {
const box = document.getElementById('box');
box.style.margin = `${margin}px`;
content.style.padding = `${padding}px`;
</script>
</body>
</html>