<header>
<h2 class="title">element.style.borderLeftStyle</h2>
<p class="description">Задає або змінює стиль лівої рамки елемента.</p>
</header>
<main>
<div class="result">
<div id="shape" class="shape"></div>
<form id="borderStyleForm">
<label for="borderStyleSelect">Змінити значення:</label>
<select id="borderStyleSelect" name="borderStyleSelect">
<option value="none">None</option>
<option value="solid">Solid</option>
<option value="dotted">Dotted</option>
<option value="dashed">Dashed</option>
<option value="double">Double</option>
<option value="groove">Groove</option>
<option value="ridge">Ridge</option>
<option value="inset">Inset</option>
<option value="outset">Outset</option>
</select>
</form>
</div>
</main>
body {
font-size: 16px;
line-height: 1.5;
font-family: monospace;
}
header {
background-color: #f1f1f1;
margin-bottom: 25px;
padding: 15px;
box-shadow: 0px 0px 3px 0px rgba(118, 118, 118, 1);
box-shadow: 0px 0px 3px 0px rgba(118, 118, 118, 1);
box-shadow: 0px 0px 3px 0px rgba(118, 118, 118, 1);
}
header h2.title {
padding-bottom: 15px;
border-bottom: 1px solid #999;
}
header p.description {
font-style: italic;
color: #222;
}
.result {
background-color: #f8f8f8;
padding: 15px;
box-shadow: 0px 0px 3px 0px rgba(118, 118, 118, 1);
box-shadow: 0px 0px 3px 0px rgba(118, 118, 118, 1);
box-shadow: 0px 0px 3px 0px rgba(118, 118, 118, 1);
}
.shape {
width: 200px;
height: 200px;
background-color: #4CAF50;
border-left: 5px solid #000;
margin-bottom: 15px;
}
form {
display: flex;
flex-direction: column;
}
label {
margin: 5px 0;
}
select {
padding: 5px;
}
let element = document.getElementById('shape');
let select = document.getElementById('borderStyleSelect');
select.addEventListener('change', () => {
let selectedStyle = select.value;
element.style.borderLeftStyle = selectedStyle;
});
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.