<html lang="en-US">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>:read-only demo — confirmation form</title>
<link href="https://fonts.googleapis.com/css?family=Josefin+Sans&display=swap" rel="stylesheet">
</head>
<body>
<form>
<fieldset>
<legend>Check shipping details</legend>
<div>
<label for="name">Name: </label>
<input id="name" name="name" type="text"
value="Mr Soft" readonly>
</div>
<div>
<label for="address">Address: </label>
<textarea id="address" name="address" readonly>
23 Elastic Way,
Viscous,
Bright Ridge,
CA
</textarea>
</div>
<div>
<label for="pcode">Zip/postal code: </label>
<input id="pcode" name="pcode" type="text"
value="94708" readonly>
</div>
</fieldset>
<fieldset>
<legend>Final instructions</legend>
<div>
<label for="sms-confirm">Send confirmation by SMS?</label>
<input id="sms-confirm" name="sms-confirm" type="checkbox">
</div>
<div>
<label for="instructions">Any special instructions?</label>
<textarea id="instructions" name="instructions"></textarea>
</div>
</fieldset>
<div><button type="button">Amend details</button></div>
<div><button type="submit">Submit</button></div>
</form>
</body>
</html>
body {
font-family: 'Josefin Sans', sans-serif;
margin: 20px auto;
max-width: 460px;
}
fieldset {
padding: 10px 30px 0;
margin-bottom: 20px;
}
legend {
color: white;
background: black;
padding: 5px 10px;
}
fieldset > div {
margin-bottom: 20px;
display: flex;
justify-content: space-between;
}
button, label, input[type="text"], textarea {
display: block;
font-family: inherit;
font-size: 100%;
padding: 0;
margin: 0;
box-sizing: border-box;
padding: 5px;
height: 30px;
}
input[type="text"], textarea {
width: 50%;
}
textarea {
height: 110px;
resize: none;
}
label {
width: 40%;
}
input:hover, input:focus, textarea:hover, textarea:focus {
background-color: #eee;
}
button {
width: 60%;
margin: 20px auto;
}
input:read-only, textarea:read-only {
border: 0;
box-shadow: none;
background-color: white;
}
textarea:read-write {
box-shadow: inset 1px 1px 3px #ccc;
border-radius: 5px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.