This example shows a labeled textarea with placeholder text. The box is styled to be wide and tall enough for comfortable typing. It also highlights when focused for better accessibility.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Textarea Example</title>
<style>
body {
font-family: Arial, sans-serif;
padding: 1rem;
background-color: #f9f9f9;
}
label {
font-weight: 600;
display: block;
margin-bottom: 0.5rem;
}
textarea {
width: 100%;
max-width: 600px;
height: 8rem;
padding: 0.5rem;
font-size: 1rem;
border: 2px solid #ccc;
border-radius: 0.25rem;
resize: vertical;
}
textarea:focus {
border-color: #007acc;
outline: none;
box-shadow: 0 0 5px #007acc;
}
</style>
</head>
<body>
<main>
<form>
<label for="comments">Your Comments:</label>
<textarea id="comments" name="comments" aria-label="Comments box" placeholder="Type your comments here..."></textarea>
</form>
</main>
</body>
</html>